Fireship · @fireship
Ruby on Rails in 100 Seconds
Uploaded June 12, 2024 · Length 3:33
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.
- 0:00
Ruby on Rails a full stack MBC web
- 0:03
framework famous for powering some of
- 0:05
the most successful internet startups of
- 0:07
the last 20 years it was created in 2004
- 0:10
by David hanm Hansen to give developers
- 0:12
a way to build largescale web
- 0:14
applications quickly with the Ruby
- 0:16
programming language it exploded in
- 0:17
popularity among the Silicon Valley Tech
- 0:19
bro scene and helped launch unicorn
- 0:21
startups like Airbnb Shopify and GitHub
- 0:24
just to name a few its underlying
- 0:26
architecture is based on the model view
- 0:28
controller pattern a model contains the
- 0:30
business Logic for your database rails
- 0:32
has a built-in om called active record
- 0:34
that can easily model relationships in a
- 0:36
SQL database on the other end we have
- 0:38
the view for presentation logic which
- 0:40
includes a mix of HTML CSS and embedded
- 0:43
Ruby which displays Dynamic data quered
- 0:46
from the back end this data is made
- 0:47
available by the controller which sits
- 0:49
in the middle it takes the incoming HTTP
- 0:51
request from the user it fetches data
- 0:53
from the model and finally responds with
- 0:55
HTML or Json this pattern actually
- 0:57
predates the web itself but rails makes
- 0:59
it extremely easy to implement by
- 1:01
following a highly opinionated and
- 1:03
controversial Doctrine which includes
- 1:05
nine Commandments like convention over
- 1:06
configuration and exalt beautiful code
- 1:09
let's build a full stack application
- 1:10
right now by installing Ruby rails and
- 1:13
SQL light now run the rails new command
- 1:15
to scaffold out a new project from here
- 1:17
you'll notice a gem file to install
- 1:18
dependencies in Ruby a rake file which
- 1:20
is like a make file in C to run a task
- 1:23
but the bulk of your code will be
- 1:24
written in the app directory in addition
- 1:26
to models views and controllers you'll
- 1:28
also notice mailers for transaction
- 1:29
actional email jobs for background work
- 1:32
and channels for real-time connections
- 1:34
via websockets and we have a JavaScript
- 1:36
directory configured with hot wire
- 1:37
allowing you to build a highly
- 1:39
interactive front end without the
- 1:40
unnecessary complexity of a JavaScript
- 1:42
component framework rails also has an
- 1:44
extremely powerful CLI generate will
- 1:46
build your models ussing controllers or
- 1:48
do everything all at once with scaffold
- 1:50
we give our model a name which is plural
- 1:52
by convention then provide some fields
- 1:54
and types we might use in the database
- 1:56
this command creates a bunch of files
- 1:58
but let's go ahead and run rake to
- 1:59
migrate the database then rail server to


