The Rails way
This course explains the ideas behind Rails, a full-stack web framework built on Ruby. It starts with where Rails came from: David Heinemeier Hansson extracted it from Basecamp. It then covers Convention over Configuration across routes, models, controllers and views, the DRY principle, and the omakase approach to curated defaults. It shows how Ruby's syntax and metaprogramming shape Rails' readable DSL. It also names two more Rails Doctrine pillars: the majestic monolith and progress over stability. The last lesson reads a small model line by line against each idea.
What you'll learn
- ✓What a full-stack framework is and where Rails came from
- ✓How Convention over Configuration links routes, models, tables, controllers and views
- ✓DRY as one authoritative place for each piece of knowledge
- ✓How omakase defaults work and when they can be swapped
- ✓How Ruby's syntax and metaprogramming support Rails' DSL
- ✓The majestic monolith and progress over stability pillars
What is Rails?
Every course so far taught Ruby the language: methods, blocks, classes, values. Rails is built on top of it. It's a full-stack web application framework, a large, opinionated set of tools and conventions for turning Ruby code into a working website. It handles everything from an incoming HTTP…
Read the full lesson free →Curriculum
7 lessonsWhat is Rails?
Rails as a full-stack Ruby framework, its origin in Basecamp, and what accepting a framework's decisions means.
One convention, applied everywhere
How resources :articles creates seven actions as eight route entries, and how naming connects every layer.
DRY: don't repeat yourself
DRY as one authoritative place for each fact, shown with a password length rule written twice.
The omakase philosophy
Omakase as Rails' curated set of default tools, which can still be swapped for a real reason.
Why Ruby for Rails?
How Ruby's parentheses-free calls, symbols and metaprogramming make Rails code like belongs_to read like sentences.
The Rails doctrine in practice
Two Rails Doctrine pillars: valuing integrated systems as a majestic monolith, and progress over stability through breaking changes.
Putting it together: reading a real Rails class
Reading a small Rails model line by line, including dependent: choices and the limits of model validations.