Understanding Rails

Understanding Rails

A free video series for developers new to Ruby on Rails, teaching the latest version.

It starts by following one click through a whole Rails app and back, then goes deeper, one part at a time.

Teaching Rails 8.1 · 33 of 72 episodes out · Assumes you can read basic Ruby

Start watching: episode 1
Jump to On the job
The map of one click's trip through a Rails app

On the job

Most of a Rails job is working in an app someone else wrote. Here you work real tickets in Switchback, a small Rails app. Refine each ticket first: ask the reporter questions and write what done looks like. Then fix it in your own fork, and CI reviews your pull request.

Ticket 001

Notes vanish sometimes

“It said ‘Note posted,’ but when I looked for it this morning it wasn't there.” Dana

Refine it Watch a senior work it

Newest episodes

Every season

Season 1: The trip of one click

Follow one click through a whole Rails 8.1 app.

  1. 1 What happens when you click overview · 3 min
  2. 2 The front door overview · 2 min
  3. 3 The router overview · 2 min
  4. 4 Controllers overview · 2 min
  5. 5 Models overview · 2 min
  6. 6 Views overview · 2 min
  7. 7 Hotwire overview · 2 min
  8. 8 Rails 8 in production overview · 2 min
  9. 9 Work that can wait overview · 2 min

Season 2: Getting started

From an empty machine to a running app, and the habits that make Rails feel easy.

  1. 10 Installing Ruby and Rails overview · 2 min
  2. 11 A tour of a new app overview · 2 min
  3. 12 The Rails way overview · 2 min
  4. 13 bin/rails, every day overview · 2 min
  5. 14 Your first scaffold, a guided tour overview · 3 min
  6. 15 The console as a lab overview · 2 min
  7. 16 Environments, configuration and credentials overview · 3 min

Season 3: Active Record in depth

The model layer, one idea at a time.

  1. 17 Migrations in depth deep dive · 7 min
  2. 18 Associations deep dive · 6 min
  3. 19 Querying deep dive · 5 min
  4. 20 The N+1 query deep dive · 4 min
  5. 21 Validations and errors deep dive · 6 min
  6. 22 Callbacks: use and misuse deep dive · 5 min
  7. 23 Scopes, enums and normalizes deep dive · 4 min
  8. 24 Transactions and locking deep dive · 5 min
  9. 25 Encrypting attributes deep dive · 4 min
  10. 26 Deprecated associations deep dive · 3 min

Season 4: Controllers, routing and auth

What happens between the router and the response.

  1. 27 Routing in depth deep dive · 4 min
  2. 28 Strong parameters and params.expect deep dive · 4 min
  3. 29 Sessions, cookies and the flash deep dive · 4 min
  4. 30 The authentication generator, line by line deep dive · 6 min
  5. 31 Authorization without a gem deep dive · 3 min
  6. 32 Rate limiting deep dive · 3 min
  7. 33 Errors, rescue_from and error pages deep dive · 3 min

Season 5: Views and the front end

HTML first, with as little JavaScript as it takes.

  1. 34 Layouts, partials and helpers Coming soon
  2. 35 Forms in depth Coming soon
  3. 36 Propshaft and the asset story Coming soon
  4. 37 Import maps or a bundler Coming soon
  5. 38 Tailwind in a Rails app Coming soon
  6. 39 Rendering Markdown Coming soon
  7. 40 Internationalization Coming soon

Season 6: Hotwire in depth

Fast, interactive pages from server-rendered HTML.

  1. 41 Turbo Drive in depth Coming soon
  2. 42 Turbo Frames in depth Coming soon
  3. 43 Turbo Streams in depth Coming soon
  4. 44 Page refreshes with morphing Coming soon
  5. 45 Stimulus in depth Coming soon
  6. 46 Hotwire Native Coming soon

Season 7: Background work and real time

Jobs, mail and live updates.

  1. 47 Active Job in depth Coming soon
  2. 48 Solid Queue in depth Coming soon
  3. 49 Job continuations Coming soon
  4. 50 Action Mailer in depth Coming soon
  5. 51 Receiving email with Action Mailbox Coming soon
  6. 52 Action Cable and Solid Cable Coming soon

Season 8: Files, rich text and caching

Uploads, editors and speed.

  1. 53 Active Storage in depth Coming soon
  2. 54 Action Text Coming soon
  3. 55 Caching in depth Coming soon

Season 9: Testing and quality

Knowing your app works, and keeping it that way.

  1. 56 How Rails tests Coming soon
  2. 57 Model and controller tests Coming soon
  3. 58 System tests Coming soon
  4. 59 Local CI with bin/ci Coming soon
  5. 60 Debugging Coming soon
  6. 61 Security basics Coming soon

Season 10: Production

Shipping it and keeping it healthy.

  1. 62 Kamal in depth Coming soon
  2. 63 Deploying without a registry Coming soon
  3. 64 Puma and Thruster in production Coming soon
  4. 65 SQLite in production Coming soon
  5. 66 Structured events Coming soon
  6. 67 Finding what's slow Coming soon
  7. 68 Upgrading Rails Coming soon

Season 11: Build it from scratch

Switchback, built start to finish, using everything so far.

  1. 69 Build Switchback: models and data Coming soon
  2. 70 Build Switchback: pages and forms Coming soon
  3. 71 Build Switchback: live and in the background Coming soon
  4. 72 Build Switchback: tested and shipped Coming soon

On the job

Real tickets in Switchback, worked the way the job works them: refine first, then fix, then review.

  1. 101 Notes vanish sometimes deep dive · 12 min
  2. 102 Eagle Ridge's page is slow deep dive · 11 min
  3. 103 Long notes get rejected deep dive · 13 min