Jump to ratings and reviews
Rate this book

Addison-Wesley Professional Ruby Series

Ruby on Rails 3 Tutorial: Learn Rails by Example

Rate this book
“Ruby on Rails™ 3 Tutorial: Learn Rails by Example by Michael Hartl has become a must read for developers learning how to build Rails apps.”

—Peter Cooper, Editor of Ruby Inside

Using Rails 3, developers can build web applications of exceptional elegance and power. Although its remarkable capabilities have made Ruby on Rails one of the world’s most popular web development frameworks, it can be challenging to learn and use. Ruby on Rails™ 3 Tutorial is the solution. Leading Rails developer Michael Hartl teaches Rails 3 by guiding you through the development of your own complete sample application using the latest techniques in Rails web development.

Drawing on his experience building RailsSpace, Insoshi, and other sophisticated Rails applications, Hartl illuminates all facets of design and implementation—including powerful new techniques that simplify and accelerate development.

You’ll find integrated tutorials not only for Rails, but also for the essential Ruby, HTML, CSS, JavaScript, and SQL skills you’ll need when developing web applications. Hartl explains how each new technique solves a real-world problem, and he demonstrates this 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 Go beyond generated code to truly understand how to build Rails applications from scratch Learn Test Driven Development (TDD) with RSpec 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 Define high-quality site layouts and data models Implement registration and authentication systems, including validation and secure passwords Update, display, and delete users Add social features and microblogging, including an introduction to Ajax Record version changes with Git and share code at GitHub Simplify application deployment with Heroku

544 pages, Paperback

First published July 28, 2010

45 people are currently reading
269 people want to read

About the author

Michael Hartl

28 books63 followers
See mhartl.com

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
196 (39%)
4 stars
207 (41%)
3 stars
79 (15%)
2 stars
12 (2%)
1 star
1 (<1%)
Displaying 1 - 30 of 35 reviews
Profile Image for Ed Limonov.
13 reviews
October 31, 2019
This book is #1 on my list of books I'd recommend to OTHER programmers. I don't know how else to elaborate on how important I thnik the ideas in this book are.
Profile Image for Geoffrey.
18 reviews
April 9, 2012
I've nearly completed the 3.2 version of this tutorial as a refresher and update for my Rails experience.

As long as you understand what this book offers, you'll probably be happy with it. Michael Hartl has delivered a thorough, easy-to-follow tutorial that is quite readable, and will give you a decent overview of what it's like to write a Rails application and pick up a few well-recommended tools along the way (RSpec, Bootstrap Framework, Factory Girl).

What it won't do is spend a lot of time walking you through lots of alternatives, explaining how the technology works, what your other choices are. All of those things would probably be a distraction to just getting an app built if you're new to Rails.

If you're looking for a deep understanding of the Rails framework and/or compatible tools, this isn't the book for you. If you're looking for a very easy-to-follow way to get started with Rails, this is a great choice.
Profile Image for Jan.
88 reviews9 followers
January 17, 2012
Nice tutorial for absolute beginners with Ruby and Rails, or even with web developing. The biggest value of this book is the fact, that author keeps "T" principle from TDD.

But there is also one major vice - Michael Hartl forgot about one part of the TDD: Refactoring. He starts every step with failing test, and he's going through the implementation, but with final design and clear code. It would be a big help for newbie programmers if book would cover refactoring topic, after EVERY new feature.

Maybe in next version?

Except that - I recommend this book for every newcommer to Rails world.
Profile Image for David.
113 reviews22 followers
July 3, 2012
If you're starting to learn Rails, follow the 3.2 book online.

This is a good intro Rails 3.0 book. I had a break from Rails and when I last worked with Rails it was version 1.4. If you already know Rails pretty well this book is too basic, but it's still a good refresher if you've been away from it. It highlights all the elegant things about Rails very well.

Things I liked about this book:
* Easy to read with a good example - highlights the benefits of Rails well
* Free website that includes the entire book, so you can copy / paste the code if you want to build the example app
* RSpec examples - this book sticks pretty closely to Test-Driven Development. There's a fine line between having good tests and having excessive tests, and this book errs on the excessive side, which is probably good for an introductory book.

Things to watch out for:
* Like most Rails books, this book is already outdated when it's published. Rails 3.2 and 3.1 changed migrations, assets, and authentication. Luckily, the 3.2 book is also available for free online
* Probably no reason to include git and Heroku - he couldn't have given enough details to make it worthwhile

Things I'm old-fashioned about:
* foreign keys - I know Rails enforces data-integrity through its models, but I wish it had foreign keys built in. It's great to know what the relationships are even if you're only looking at the database. Also, I prefer having two levels of data-integrity protection - at the app level and at the db level.
Profile Image for Jaret Manuel.
69 reviews11 followers
March 20, 2012
This is a good resource but not a great place for an absolute beginner to start. The 3.2 version is better then the older one, however it is easy to get lost or get errors, and not know where to pick up.
4 reviews8 followers
February 11, 2021
Just finished Ruby on Rails Tutorial by Michael Hartl. The 20-hour video teaches you to write a fully functions Twitter web app end to end, of course, with Ruby on Rails as framework. The tutorial covers all aspects of techniques in Rails from MVC, templates, partials, filters, validations, callbacks, security all the way to testing and even deploy to production via Heroku.
I have read a book a pure Ruby but have no experience in Rails. This tutorial let me know the basics and some details of this framework. Even though I get lost sometimes when following the video, I can always find answers from Rails doc online. Ruby on Rails is a very powerful and complete framework to build modern web applications. The framework stretches across data storage, middleware all the way up to frontend. The embedded Ruby is especially flexible when used in frontend code like HTML and Javascript. This framework has encapsulated lots of functionalities which can be complicated to build like pagination, pluralization and security. At the same time it does not put too much constraints on developers, you have fair amount of flexibilities to make the app fit your needs.
My only complaint of this tutorial is most of the videos are still the previous version which is out of sync with what the new version book, also using outdated Rails version. This can be confusing sometimes. I have to jump between video and book sometimes which was cumbersome.
Profile Image for Bilal.
113 reviews9 followers
April 28, 2020
(This review is for the 4th ed.)

If you want to learn web-development with the rails framework, this is the book to get.
Profile Image for Jeff Standard.
42 reviews4 followers
June 25, 2013
Just finished going through the free online version and it's in contention for the best programming book I've ever read. I recommend this book to anyone with programming experience looking to understand the Ruby on Rails stack. If you're new to programming, I'd recommend starting more with codeacademy or an online resource that handles all the environment setup stuff, and then come back to this book after you have your feet wet.

The content is, on the whole, fairly well explained, getting conceptual where necessary and letting you know when you don't have to think too hard about a certain concept just yet. The online format was filled with useful links to dig deeper into certain areas. The editing was also great, I found only one instance where it seemed like the code was out of order with the testing. There is quite a bit of legwork involved in getting to know your environment, but I, as the authored warned I would, actually ended up appreciating the amount of time spent with Git and Rails before actually programming.

I would have liked a bit more explanation about rspec/capybara syntax though. So much of the book seems a whirlwind tour of rspec and I had to spend a great deal of research on my own to understand some fundamental concepts which could have been covered better in the book (ex. variable scoping within tests).
421 reviews84 followers
April 2, 2012
Excellent Rails tutorial. It's frighteningly thorough, discussing Ruby, ERb, RSpec, Test-Driven Development, ActiveRecord, SQL, JavaScript, HTML, CSS, web design, REST, and of course, Rails. In only one book, you're walked through a mostly complete Twitter-like web application. The amazing thing is how fairly easy it all is to follow, even if you're not very acquainted with them.

The author doesn't miss a single detail, and all the explanations are very straightforward. He's obviously knows his stuff, not only about Ruby on Rails. The guy is a Harvard graduate, and an award-winning theoretical and computational physics professor at Caltech. And here is writing a basic Rails tutorial, so it's obviously a passion.

Although this book is impressively detailed for a tutorial, it is nonetheless only a tutorial, so don't expect to gain an in-depth understanding of any of the subjects it covers. It's designed to be a broad-brush overview, from beginning to end, to expose you to all the pieces, and give you a starting point for learning more about those pieces. For that reason, this book makes an excellent first book on Rails.
Profile Image for Tanner Welsh.
37 reviews7 followers
March 31, 2012
If you want to learn how to build a basic web application in Rails, and hone your programming technique in the process, this is an excellent guide. Using TDD (Test-Drivin-Development) from the outset, along with Git version tracking, this tutorial takes you through each stage of planning and developing a Twitter-like app.

There is not much energy expended on any particular topic, but the pace of progress is steady and the exercises are challenging enough to engage active learners without being unnecessarily difficult so as to prohibit the uninitiated.

It would be helpful to have some knowledge of programming concepts and terminology before starting, but in general most of the problems are accessible to novice programmers. Intermediate-level Ruby developers will find his emphasis on best practices insightful.

Overall, a great read, and a great project. It is really great to walk away from a heavy textbook with a fully-formed and functional web application that you can expand and play with.
Profile Image for Eric Brooke.
111 reviews18 followers
April 19, 2013
This is properly one of the best programmer books I have read. It takes you from zero to having strong foundation of Ruby on Rails, Test driven development with RSpec, how the Model View Controller pattern actually works, how to use GIT (version control) whilst building a basic web app.

With peaks and introductions to whole bunch of other stuff giving you a taste so you can choose to explore further. It is free online which is amazing and whats more it is even regularly updated on line. I bought the first edition and never got to and and then bought the second edition. I have no issue with buying the books out of respect for what Michael Hartl and the community have pulled together.

I just wish you could pull down a pdf after buying the book, without having to buy it again :-( For those offline times
Profile Image for Charity.
272 reviews
November 17, 2012
The best! This book is the most clear, understandable, and implementable of all the tutorial books I have been reading for the last month. He explains what is required, why, and how. The theory is explained in a way that is clear and more resources are cited for those who want to delve deeper into the programming languages, development environments, servers, scaffolding, version control theory, or gemlibraries.

The examples are simple but easily scalable. Hooray! The author is someone who can use english correctly and adeptly... and has the technical knowledge I am trying to acquire!

You can find it online for free, with all its cool links to other resources.
4 reviews2 followers
December 14, 2011
This book is not only good but it's complete.

A number of other books i've read around the world of Rails do not cover more complex concepts behind associations and testing (!!!!). Michael's writings here not only show how to connect the dots of rails (mvc+more) but the app he builds is interesting and from the start you are doing TDD.

I bought this book and read it after already having experience with Rails and still found it super useful. I've also passed emails with Michael when i had questions -- he was super responsive and all around just a really nice guy.
Profile Image for Rob Prouse.
8 reviews2 followers
February 10, 2011
If you want to learn Ruby on Rails, this book and Agile Web Development with Rails are the books you want to read. The book takes you step by step through developing a web application and if you follow along, coding as you go, you will gain a good understanding of Ruby and Rails.

I especially like the exercises at the end of each chapter that allow you to practice what you've learned and dive in a little bit deeper.

Make sure you check out the book's website at http://railstutorial.org/
Profile Image for Joseph.
8 reviews
April 17, 2013
A little too specific. I'm not a novice coder, but I'm new to ruby and as I was using a different build than the one in the tutorial I was often lost for no reason other than the fact that the book simply told me to find my own answers. I spent more time googling answers to complete the app then actually reading the book. It's good but not the best.
Profile Image for Huang Wei.
5 reviews2 followers
April 1, 2011
This is the first web programming book I read. I've learned a lot useful tips and tricks besides rails 3. I think it's a good tutorial book for programmers who have little experience on web programming and Ruby on Rails.
Profile Image for Shamma Al Hetmi.
6 reviews12 followers
June 2, 2012
We were assigned this tutorial book in my app development and design class. I found it incredibly useful. It is amazing for people just starting out with ruby on rails, and by the end of the book, you end up creating your very own twitter-like application. It's awesome.
Profile Image for Arthur Zhuk.
102 reviews2 followers
October 18, 2015
One of the best books for learning rails development I've worked through. In this book you will go over, Rails, Git, RSpec, Bootstrap, PostgreSQL (I believe) and more. By the end you will have created your own Twitter clone application. Book is very well structured.
1 review
May 17, 2011
Really quick and clean way to get you started. Best for beginners like me.
8 reviews5 followers
October 7, 2011
By far the best book for learning Ruby on Rails. Bar none.
37 reviews
September 9, 2012
A thorough and effective follow-along guide to everything needed to develop web apps with Rails. Definitely planning to re-read the new editions.
Profile Image for Michael Welburn.
16 reviews
October 27, 2013
Very basic walkthrough to learn Rails in a weekend that works (if you have any prior programming experience).
Profile Image for Will.
10 reviews51 followers
January 2, 2015
great guide to start learning rails. I now feel like I have a foundation to really start building something of my own.
Displaying 1 - 30 of 35 reviews

Can't find what you're looking for?

Get help and learn more about the design.