Obie did it, again. With the second edition of his former masterpiece, The Rails Way, he managed to outdo himself delivering a new, even more useful, Rails Bible. Wether you’re a Ruby on Rails professional like him or just an enthusiast, this book is pretty much everything you need to learn how to master the third release of DHH’s Ruby web framework.

The Rails 3 Way is no ordinary second edition. If you already own The Rails Way, you’ll be pleasantly surprised that this is a different, more polished book. While something had to remain the same, there’s a lot of new content in its 708 pages, and even the old content has been rewritten or at least revised.

It doesn’t matter whether you already know Rails 2.x or you’re jumping straight into the Rails 3 world, if you use Rails, you can’t miss this book.

I started the review of the first edition with a quote from my fiancée (now wife) on how pointless programming books are, especially those dealing with newish technologies: they tend to go out of date fairly quickly. While this still holds true, there’s not much you can do about it, except maybe purchasing a digital edition of the book instead. However, if you want to keep a good Rails reference book by your side, this has to be the one.

What's New The Rails Way vs. The Rails 3 Way If you put The Rails 3 Way and the original The Rails Way one next to the other, you can see that the new book is considerably shorter: about 200 pages less. This doesn’t mean it contains less information, quite the opposite: the new book contains a lot more stuff with less fluff. Obie managed to reduce digressions to a bare minimum and focus on providing more informative content to the readers using less text. Think of it as a fat-free book. While no What’s new in Rails 3 section is included in the book, Obie points out the new stuff when needed (but not always). An example is chapter 12, Ajax on Rails, in which changes introduced by Rails 3 clearly stand out, especially the section on Unobtrusive JavaScript (UJS). Although the book is divided into chapters, it can also be divided into parts (each dealing with a specific theme) simply by looking at the front edge. According to this theme-based partitioning, Active Record makes up for nearly a quarter of the book (173 pages), followed by Active Support API appendix and the All About Helpers chapter. Another nice addition that can really make the difference when you’re in a hurry is the Method Index, which is separate from the main Index. It seems to account for all the methods in all (or at least the most important) classes in Rails. I didn’t check method by method, but it is pretty comprehensive nonetheless, based on some quick spot checking.

Contents Active Record makes up for over 24% of the book The first thing you notice once you read the first few pages, is that this book is even more opinioned than its predecessor. Even though Rails 3 is less opinionated than early versions, in that it allows for easy reconfiguration of Rails assumptions, this book is more opinionated than ever. – Obie Fernandez, Introduction to The Rails Way In other words, you won’t find an ERb view in the whole book (Haml rulez!) and if you don’t like RSpec… well, you’d better skip Chapter 18 altogether. The other big difference with traditional Ruby and Rails books is the amount of reference to third-party code, mainly rubygems. Rails comes with no authentication functionality? So what: Authlogic and Devise are great for the job, go check them out! Do you need to test your Active Mailer emails? email-spec is all you need. I was actually surprised to find so much content not strictly related to Rails in this book: the first chapter starts off with Bundler (now a Rails dependency, however), Chapter 2 (Routes) mentions Rack, and so does Chapter 4 (Controllers). If you want a nice and to-the-point practical introduction to RSpec, the first part of Chapter 18 covers that. About 40% of the book is reference material Then there’s reference material. Plenty of it, a good 40% I daresay. The good thing is that (unlike the first edition) it won’t bore you to death: take Chapter 5 (Working with Active Record) for example, you’ll fly through find-related methods so swiftly you’ll regret when it’s over. Active Support? I didn’t read every line of Appendix B, but when I want to know something about inflection methods I will know exactly where to find them, and what to expect: the method signature, a few lines of text, and a short example at most. My only regret? Cheat sheets. Or better, the lack of them. More tables, please! Granted, the web is full of Rails cheat sheets, but a few of them at the end of the book or even in a separate foldable add-on like in the Pragmatic Programmer can’t hurt. Finally, some words about the code examples. The code/text ratio is almost 1:1, but Obie’s choice of not turning this book into a huge tutorial by implementing a single example application was absolutely right: The code snippets used in throughout the book are concise and relevant to the text around them and won’t distrupt your reading. If you want to play with them, they’re even on GitHub for you to clone and fork.

Organization and Writing Style Yes, it’s a long book. But you don’t

have to read it from start to finish! The Rails 3 Way is a book for Rails professionals. If you don’t know Ruby or if you never heard of Ruby on Rails, this book is not for you. It won’t teach you what MVC is, it won’t waste time on explaining convention over configuration, it won’t even describe the structure of a Rails app! If you’re newcomer to Rails… well, that’s what The Rails Tutorial is for. To be honest, I’m with Obie on this. If this book had been beginner-friendly, it would have been even longer than the previous edition, and probably more boring. Instead, by assuming that the reader has been already initiated to the world of Ruby and Rails, the author can dive into the framework straight away. Moreover, chapters are not ordered by difficulty: they don’t need to be, they need to be ordered in a way that makes sense for a Rails developer. Once again, this book includes personal sidebars used to voice the opinion of one of the co-authors or Rails gurus: there are plenty of “Yehuda says”, “Xavier says”, “Durran says”, and so on. Nothing new there, it’s just a nice way to provide the reader with authoritative opinions on some matters. As I progressed through the book, I started noticing how Obie anticipated my questions and doubts: I found this to be a remarkable feature of this book, and an excellent way to make the readers feel they are on the same page with the author. If something should not be done because it may cause you problems, the author won’t hold back. See page 214, “Extra Columns on has_and_belongs_to_many Join Tables”, for example: it’s a cool feature, but it can cause all sort of annoyances, and the bottom line is: use has_many :through instead, if you need extra columns on join tables.