Free through lesson 3

Ruby & Ruby on Rails for Beginners

From Ruby syntax to Rails MVC, Active Record, forms and authentication, testing with RSpec, Hotwire, and deploying with Docker and Kamal. In 50 lessons, you'll get to the point where you can build and launch a members-only blog with login. All code, command output, and test results were actually run on Ruby 3.4.10 and Rails 8.1.3.1.

Curriculum

The 50 lessons are split into 7 chapters. We recommend going in order from chapter 1, but feel free to jump to whatever interests you. * Ruby and Rails can't run in the browser, so try things with the Ruby 3.4 you install in lesson 2 and the Rails 8.1 app you create in lesson 9.

Chapter 1 — Ruby Syntax (lessons 1–8)

Before getting into Rails, you'll learn to write Ruby itself. You'll cover variables and methods, arrays and hashes, blocks, classes and modules, and exceptions, running everything with the ruby command as you go.

1

What Is Ruby? (Everything Is an Object)

A first look at Ruby, the foundation of Rails. Learn two quirks: even numbers have methods, and the last evaluated expression is the return value.

Free
2

Setting Up (rbenv, gem, Bundler)

Pin the Ruby version per project. The difference between gem and Bundler, what Gemfile and Gemfile.lock do, and why you use bundle exec.

Free
3

Variables and Methods (Passing Arguments)

Local variables, instance variables, and constants. Default arguments, keyword arguments, variable-length arguments, and the convention for method names ending in ? and !.

Free
4

Conditionals and Loops (unless and each)

How to write if, unless, and case/in, and why you loop with each or times instead of for. Plus modifier if and guard clauses for exiting early.

🔒 Basic
5

Arrays and Hashes

Creating arrays and getting values out, symbol keys in hashes, and digging into nested data. Plus how Rails params is a hash.

🔒 Basic
6

Blocks and Enumerable (map, select, reduce)

Dig into blocks, the reason Rails code is so short. When to use do…end vs { }, how map differs from each, and what &:name really is.

🔒 Basic
7

Classes and Modules (Inheritance and Mixins)

attr_accessor, initialize, inheritance, and super. Plus how mixins, which include a module to blend in features, are exactly what Rails concerns are.

🔒 Basic
8

Exceptions and Gems (rescue and Bundler)

How to write begin/rescue/ensure and raise. Why you define your own exception classes, and the steps from adding a gem to the Gemfile to running bundle install.

🔒 Basic

Chapter 2 — Getting Rails Running (lessons 9–15)

You'll create an app with rails new and follow how the three pieces, routing, controllers, and views, connect. By the end of this chapter, you'll be able to add a URL and show your own page.

Chapter 3 — Active Record (lessons 16–23)

You'll create tables with migrations and read and write them through models. You'll work through validations, associations, and scopes, and finish by spotting N+1 queries in the logs and fixing them.

Chapter 4 — Forms and Authentication (lessons 24–31)

You'll accept input with form_with and use Strong Parameters to limit which fields are accepted. You'll write authentication by hand with has_secure_password, then replace it with Devise, and finish by making sure users can edit only their own posts.

Chapter 5 — Testing and Quality (lessons 32–38)

So you notice right away when something breaks, you'll run both Minitest and RSpec. You'll create test data with FactoryBot, check whole pages with request specs, and let RuboCop and Brakeman review your style and security holes for you.

Chapter 6 — Real-World Features (lessons 39–45)

You'll use Hotwire to update parts of the page with almost no JavaScript, and Active Job to push heavy work into the background. You'll also cover file uploads, email, and translating your app into Japanese: the things that always come up in real work.

Chapter 7 — Build and Launch (lessons 46–50)

With credentials and environment variables, asset precompilation, and Docker and Kamal, you'll get your app into a shape you can launch. Finally, you'll compare it side by side with Laravel and get a map of where to go next.

Once you finish all 50 lessons, move on to Database Fundamentals with PostgreSQL to learn indexes and query plans in depth, PHP & Laravel Intro Course to see the same kind of full-stack framework in another language, or Intro to Shipping and Running a Service to learn how to run things after launch. A membership unlocks every course.