Fireship · @fireship

Ruby on Rails in 100 Seconds

Uploaded June 12, 2024 · Length 3:33

Ruby on Rails in 100 Seconds

Summary

A 100-second introduction to Ruby on Rails, a full-stack web framework for building large-scale web applications quickly with Ruby.

  • ruby on rails
  • web development
  • full stack framework
  • ruby programming language

Transcript preview

The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.

  1. 0:00

    Ruby on Rails a full stack MBC web

  2. 0:03

    framework famous for powering some of

  3. 0:05

    the most successful internet startups of

  4. 0:07

    the last 20 years it was created in 2004

  5. 0:10

    by David hanm Hansen to give developers

  6. 0:12

    a way to build largescale web

  7. 0:14

    applications quickly with the Ruby

  8. 0:16

    programming language it exploded in

  9. 0:17

    popularity among the Silicon Valley Tech

  10. 0:19

    bro scene and helped launch unicorn

  11. 0:21

    startups like Airbnb Shopify and GitHub

  12. 0:24

    just to name a few its underlying

  13. 0:26

    architecture is based on the model view

  14. 0:28

    controller pattern a model contains the

  15. 0:30

    business Logic for your database rails

  16. 0:32

    has a built-in om called active record

  17. 0:34

    that can easily model relationships in a

  18. 0:36

    SQL database on the other end we have

  19. 0:38

    the view for presentation logic which

  20. 0:40

    includes a mix of HTML CSS and embedded

  21. 0:43

    Ruby which displays Dynamic data quered

  22. 0:46

    from the back end this data is made

  23. 0:47

    available by the controller which sits

  24. 0:49

    in the middle it takes the incoming HTTP

  25. 0:51

    request from the user it fetches data

  26. 0:53

    from the model and finally responds with

  27. 0:55

    HTML or Json this pattern actually

  28. 0:57

    predates the web itself but rails makes

  29. 0:59

    it extremely easy to implement by

  30. 1:01

    following a highly opinionated and

  31. 1:03

    controversial Doctrine which includes

  32. 1:05

    nine Commandments like convention over

  33. 1:06

    configuration and exalt beautiful code

  34. 1:09

    let's build a full stack application

  35. 1:10

    right now by installing Ruby rails and

  36. 1:13

    SQL light now run the rails new command

  37. 1:15

    to scaffold out a new project from here

  38. 1:17

    you'll notice a gem file to install

  39. 1:18

    dependencies in Ruby a rake file which

  40. 1:20

    is like a make file in C to run a task

  41. 1:23

    but the bulk of your code will be

  42. 1:24

    written in the app directory in addition

  43. 1:26

    to models views and controllers you'll

  44. 1:28

    also notice mailers for transaction

  45. 1:29

    actional email jobs for background work

  46. 1:32

    and channels for real-time connections

  47. 1:34

    via websockets and we have a JavaScript

  48. 1:36

    directory configured with hot wire

  49. 1:37

    allowing you to build a highly

  50. 1:39

    interactive front end without the

  51. 1:40

    unnecessary complexity of a JavaScript

  52. 1:42

    component framework rails also has an

  53. 1:44

    extremely powerful CLI generate will

  54. 1:46

    build your models ussing controllers or

  55. 1:48

    do everything all at once with scaffold

  56. 1:50

    we give our model a name which is plural

  57. 1:52

    by convention then provide some fields

  58. 1:54

    and types we might use in the database

  59. 1:56

    this command creates a bunch of files

  60. 1:58

    but let's go ahead and run rake to

  61. 1:59

    migrate the database then rail server to