Download the app

Scan. It's in your pocket.

QR Code — Dygest

Open the Camera app and point it at the code. Free to try.

Ruby on Rails Tutorial

Ruby on Rails Tutorial

Building web apps with Rails

Listen to the podcast excerpt:
0:00 --:--

Description

Most programming books start where nothing works yet: install this, configure that, print "hello world" to a black terminal, and trust that in three hundred pages it will add up to something. Michael Hartl's Ruby on Rails Tutorial does almost the opposite. Within the first chapter, the reader has a real application running on a live URL, visible to anyone with a browser. It does nothing useful — a single page that says hello — but it is deployed, on the actual internet, before the reader has understood a line of what makes it work. That inversion is the whole pedagogy of the book, and it explains why the tutorial became, over several editions since 2010, one of the most widely used on-ramps into professional web development.

Ruby on Rails is a framework — a set of conventions and prewritten machinery that lets a developer build a database-backed web application without reinventing the plumbing every time. Created by David Heinemeier Hansson in 2004, it made a wager that most web apps resemble each other closely enough that the framework should make the common choices for you. Hartl's book teaches Rails, but it teaches something larger by the way it teaches: it refuses to separate learning from doing, and it treats a beginner as someone who should be shipping code, testing it, and deploying it from the first week rather than the last.

The result is a book that reads less like a manual and more like an apprenticeship. Over its length the reader builds one substantial application — a working Twitter-like social app with users, sessions, passwords, image uploads and a following system — and every concept arrives because the app needs it, not because a syllabus says it is time. The method is demanding, and it asks the reader to type nearly everything by hand. What it produces is not just knowledge of Rails but the muscle memory of building.

The question we’re asking : How does a book turn a total beginner into someone who can build and ship a real web application?What we’ll see : How the tutorial's built-app-first method, its reliance on Rails conventions, its insistence on testing, and its early deployment together add up to a way of learning that mirrors the job itself.

Table of contents

01

Chapter 1 — The sample app that teaches by shipping

The spine of the tutorial is a single application built up over the whole book, and the choice to build one substantial thing rather than many small ones is the first pedagogical decision worth noticing. The app is modeled loosely on a microblogging service — users sign up, log in, post short messages, upload a profile picture, and follow each other. It is not a toy. By the end, it has account activation by email, password resets, secure sessions, pagination, image processing and a working feed of posts from the people a user follows. Every feature is one a real product would need, which means every technique the reader learns is one they would actually use.

The book gets there in stages, and the sequencing is deliberate. Before the sample app proper, Hartl walks the reader through two smaller warm-ups: the bare hello-world app of chapter one, and a scaffold-generated demo that shows what Rails can produce automatically. Then he takes the scaffolding away. The point of showing the automatic version and then discarding it is to make clear that the magic is not magic — the reader will rebuild the same functionality by hand, understanding each piece, so that when something breaks in real work they know where to look.

Download Dygest

for the full experience!

02

Chapter 2 — Convention over con­fig­u­ra­tion, and why it holds

Rails rests on a principle its creator named "convention over configuration," and the tutorial leans on it hard. The idea is that a framework should make sensible default choices so the developer does not have to specify everything. If a table is called users, Rails assumes the model is called User; if a controller has an action called show, Rails knows to look for a matching view file without being told. A developer who follows the conventions writes strikingly little glue code. One who fights them ends up writing more than they would have in a bare-bones setup.

For a beginner this is a double-edged gift, and the book handles the edge carefully. The conventions mean the reader can build real features fast, without drowning in setup files. But they also mean a lot happens invisibly, and invisible behavior is exactly what confuses newcomers when it goes wrong. Hartl's answer is to name the conventions explicitly as they appear — to point out, each time Rails does something automatically, what rule made it happen. The reader learns not just that it works but why, which is what separates using a framework from being at its mercy.

Download Dygest

for the full experience!

03

Chapter 3 — The test that comes before the code

One of the tutorial's firmest commitments, and the one beginners resist most, is automated testing. Rather than checking whether a feature works by clicking through the browser each time, the reader writes small programs — tests — that check the app's behavior automatically and report failures instantly. The book weaves these in from early on, and it keeps returning to a discipline where, for many features, the test is written first: you describe what the code should do, watch the test fail because the code does not exist yet, then write just enough code to make it pass.

Writing the test first sounds backwards until you have done it a few times. Its value is that it forces you to decide what "working" means before you start, in concrete, checkable terms. A test that says a user cannot sign up with a blank email address is a specification you can run. When the code finally makes that test pass, you have a guarantee, and the guarantee stays true forever — every time you change the app afterward, the whole suite of tests runs again and tells you immediately if you broke something that used to work.

Download Dygest

for the full experience!

04

Chapter 4 — Deploy on day one

Step back from the specific techniques and the tutorial's deepest choice comes into focus: the reader deploys to production almost immediately, and keeps deploying throughout. That hello-world app in chapter one does not just run on the reader's laptop; it goes live on a hosting service where anyone can visit it. This is unusual. Most courses treat deployment as the final, scary chapter — the part you reach if you make it. The book treats it as something you do constantly, from the beginning, before you even understand it fully.

The reasoning is that deployment is where beginners most often stall, precisely because it is postponed until everything else is already overwhelming. By making it routine from the first hour, the tutorial defuses it. More than that, it changes the nature of what the reader is learning. A program that only runs on your own machine is a private exercise; a program running on a public URL is a product, however small. The reader spends the whole book in the second mode, which is the mode real developers live in.

Download Dygest

for the full experience!

05

Conclusion

The reader who finishes the tutorial ends up where they started, at a deployed application — except now it is a full social app they built and understand piece by piece, protected by tests they wrote, running on a URL they can share. The hello-world page of chapter one turns out to have been a promise: everything you build here will be real, and it will be live. The book kept that promise across every feature, refusing at each step to let learning drift apart from doing.

Download Dygest

for the full experience!