Ruby on Rails Tutorial

Ruby on Rails Tutorial : Learn Web Development with Rails

4.31 (546 ratings by Goodreads)
By (author) 

Free delivery worldwide

Available. Expected delivery to the United States in 6-11 business days.

Not ordering to the United States? Click here.


"Ruby on Rails (TM) Tutorial by Michael Hartl has become a must-read for developers learning how to build Rails apps."

- Peter Cooper, Editor of Ruby Inside

Used by sites as varied as Twitter, GitHub, Disney, and Airbnb, Ruby on Rails is one of the most popular frameworks for developing web applications, but it can be challenging to learn and use. Whether you're new to web development or new only to Rails, Ruby on Rails (TM) Tutorial, Fourth Edition, is the solution.

Best-selling author and leading Rails developer Michael Hartl teaches Rails by guiding you through the development of three example applications of increasing sophistication. The tutorial's examples focus on the general principles of web development needed for virtually any kind of website. The updates to this edition include full compatibility with Rails 5, a division of the largest chapters into more manageable units, and a huge number of new exercises interspersed in each chapter for maximum reinforcement of the material.

This indispensable guide provides integrated tutorials not only for Rails, but also for the essential Ruby, HTML, CSS, and SQL skills you need when developing web applications. Hartl explains how each new technique solves a real-world problem, and then he demonstrates it with bite-sized code that's simple enough to understand, yet novel enough to be useful. Whatever your previous web development experience, this book will guide you to true Rails mastery.

This book will help you

Install and set up your Rails development environment, including pre-installed integrated development environment (IDE) in the cloud
Go beyond generated code to truly understand how to build Rails applications from scratch
Learn testing and test-driven development (TDD)
Effectively use the Model-View-Controller (MVC) pattern
Structure applications using the REST architecture
Build static pages and transform them into dynamic ones
Master the Ruby programming skills all Rails developers need
Create high-quality site layouts and data models
Implement registration and authentication systems, including validation and secure passwords
Update, display, and delete users
Upload images in production using a cloud storage service
Implement account activation and password reset, including sending email with Rails
Add social features and microblogging, including an introduction to Ajax
Record version changes with Git and create a secure remote repository at Bitbucket
Deploy your applications early and often with Heroku
show more

Product details

  • Paperback | 816 pages
  • 180 x 230 x 40mm | 1,304g
  • Addison Wesley
  • Boston, United States
  • English
  • 4th edition
  • 0134598628
  • 9780134598628
  • 494,847

Table of contents

Chapter 1: From Zero to Deploy
Chapter 2: A Toy App
Chapter 3: Mostly Static Pages
Chapter 4: Rails-Flavored Ruby
Chapter 5: Filling in the Layout
Chapter 6: Modeling Users
Chapter 7: Sign Up
Chapter 8: Basic Login
Chapter 9: Advanced Login
Chapter 10: Updating, Showing, and Deleting Users
Chapter 11: Account Activation
Chapter 12: Password Reset
Chapter 13: User Microposts
Chapter 14: Following Users
show more

Review quote

Praise for Michael Hartl's Books and Videos on Ruby on Rails

"My former company (CD Baby) was one of the first to loudly switch to Ruby on Rails, and then even more loudly switch back to PHP. (Google me to read about the drama.) This book by Michael Hartl came so highly recommended that I had to try it, and the Ruby on Rails(TM) Tutorial is what I used to switch back to Rails again."

-From the Foreword by Derek Sivers (

Formerly: founder of CD Baby

Currently: founder of Thoughts Ltd.

"Michael Hartl's Rails Tutorial book is the #1 (and only, in my opinion) place to start when it comes to books about learning Rails. . . . It's an amazing piece of work and, unusually, walks you through building a Rails app from start to finish with testing. If you want to read just one book and feel like a Rails master by the end of it, pick the Ruby on Rails(TM) Tutorial."

-Peter Cooper, editor, Ruby Inside

"For the self-motivated reader who responds well to the 'learn by doing' method and is prepared to put in the effort, this comes highly recommended."

-Ian Elliot, reviewer, I Programmer

"Ruby on Rails(TM) Tutorial is a lot of work, but if you're careful and patient, you'll learn a lot."

-Jason Shen, tech entrepreneur, blogger at The Art of Ass-Kicking

"Michael Hartl's Ruby on Rails(TM) Tutorial seamlessly taught me about not only Ruby on Rails, but also the underlying Ruby language, HTML, CSS, a bit of JavaScript, and even some SQL-but most importantly it showed me how to build a web application (Twitter) in a short amount of time."

-Mattan Griffel, co-founder & CEO of One Month

"Although I'm a Python/Django developer by trade, I can't stress enough how much this book has helped me. As an undergraduate, completely detached from industry, this book showed me how to use version control, how to write tests, and, most importantly-despite the steep learning curve for setting up and getting stuff running-how the end result of perseverance is extremely gratifying. It made me fall in love with technology all over again. This is the book I direct all my friends to who want to start learning programming/building stuff. Thank you Michael!"

-Prakhar Srivastav, software engineer,, Kuwait

"It doesn't matter what you think you will be developing with in the future or what the framework du jour is; if you want to learn how to build something, there is no better place to start than with this tutorial. And for all the 'non-technical' people out there who want to see their ideas come to life, who are considering hiring contractors, paying for a class, or 'founder dating' in the search for a technical co-founder: stop. Take a step back. Forget about your idea for a short while and immerse yourself in this tutorial to learn what it takes to put something together. You and your software-related projects will be better for it."

-Vincent C., entrepreneur and developer

show more

About Michael Hartl

Michael Hartl is a best-selling author and founder of the educational website His prior experience includes writing and developing RailsSpace, an extremely obsolete Rails tutorial book, and developing Insoshi, a once-popular and now-obsolete social networking platform in Ruby on Rails. In 2011, Michael received a Ruby Hero Award for his contributions to the Ruby community. He is a graduate of Harvard College, has a Ph.D. in Physics from Caltech, and is an alumnus of the Y Combinator entrepreneur program.
show more

Rating details

546 ratings
4.31 out of 5 stars
5 47% (259)
4 40% (216)
3 10% (53)
2 3% (15)
1 1% (3)
Book ratings by Goodreads
Goodreads is the world's largest site for readers with over 50 million reviews. We're featuring millions of their reader ratings on our book pages to help you find your new favourite book. Close X