The Bottom Line
Ruby on Rails 3 Tutoial: Learn Rails by Example by Michael Hartl is a hands on introduction to not only Ruby on Rails but all the related software and services many Rails developers use such as Git, Github, Heroku and RSpec. There are no long-winded discussions on theory or REST or MVC, each and every part of every chapter is a hands on exercise in building a Rails application. This book is recommended for anyone who prefers a hands on approach to learning.
- Very hands on, every section builds a useful section of the application.
- Software and services related to Rails are used heavily, including Git, Github, Heroku and RSpec.
- Approachable by anyone with even minimal Ruby experience, and no Rails experience.
- A single application is built from start to finish over the course of the book.
- Also available online in HTML form.
- Not much discussion of what's going on behind the scenes.
- At the end, you'll know how to build simple Rails applications, but not now Rails works.
- The online version is every bit as good, but is also free.
- Chapter 1 covers installing Rails and using things like Git, Github and Heroku.
- Chapters 2 and 3 detail the application to be built over the course of the book (a Twitter clone) and static pages.
- Chapter 4 teaches a few Ruby fundamentals. This is the only chapter not directly related to building the demo application.
- Chapter 5 covers CSS layouts as well as links (the Rails way) and starts creating the Users controller.
- Chapters 6 and 7 flesh out the Users model, including validations, and implements authentication and authorization.
- Chapters 8 and 9 build the registration form, and logging in and out.
- Chapter 10 handles some administration and user profile features like showing and deleting users.
- Chapter 11 finally gets to implementing microposts, and a true Twitter clone is now functional.
- Chapter 12 caps off the Twitter clone and adds the ability for users to follow each other.
Guide Review - Ruby on Rails 3 Tutorial: Learn Rails by Example
Ruby on Rails 3 Tutorial: Learn Rails by Example by Michael Hartl is about as hands on as you can get with a Ruby tutorial. With the exception of chapter 4 (which teaches some Ruby fundamentals, just enough to get by), every section of every chapter brings you closer to completing a Twitter clone. This is contrary to many other Ruby on Rails books, which opt to teach the philosophies behind Rails, REST and the like. This, however, is not the same as the countless other Ruby on Rails tutorials that show you little more than what to type where in order to do something. Ruby on Rails 3 Tutorial: Learn Rails by Example sits somewhere in the middle, showing you more than the lightning speed tutorials, and discussing less than the "heavier" books.
One of the core principals of this book is the heavy use of Git, test-driven development with RSpec, Github and Heroku. They're not discussed at the beginning of the book as an "if you so desire" feature, they're prominently featured throughout the text. And while there are certainly other ways of doing these things (or you could not do them at all), they're the most widely used tools for version control, collaboration, test-driven development and deploying in the Ruby on Rails world. Teaching them heavily along-side Rails is a huge plus.
The demo application you'll be building throughout this book is a Twitter clone. And, after reading the table of contents, you get the impression that it spends most of the pages creating the Users model, controller and views, it does. This is not such a bad thing, the Users resource is the most complex in the demo application and, while you won't be putting many pages on the screen, learning how to do one resource in depth like this prepares you to create your own resources.
At the end of every chapter there are a number of exercises that reinforce what you've learned thus far and test your self-sufficiency. It's highly recommended that you do these exercises, as doing them breaks you from the "read and repeat" pattern that the book can get you into. Even if you find yourself skipping ahead to the code, these exercises will have you going back to read again, and cementing your knowledge.
Overall, Ruby on Rails 3 Tutorial: Learn Rails by Example is an excellent book. Though it is a tutorial, it's a bit more than a "type this to achieve this effect" type of tutorial. At the end, you'll have a solid understanding of how Rails applications are put together. And, at the time of this review, Michael Hartl is busy turning this entire series of tutorials into a series of screencasts, so you can read, following along and practice on your own.