Here's another entry in my ongoing Rails book review series.
Title: The Rails Way
Author: Obie Fernandez
The latest entry in Addison-Wesley's Professional Ruby Series is The Rails Way, by Obie Fernandez. The name is a nod to Hal Fulton's noble classic The Ruby Way, and it's clear this book aims to be as significant a feature in the Rails publishing landscape. The good news is that the book delivers, and then some. The Rails Way appears destined to become the new bible of Rails development.
Before I dive into the full review, a disclaimer. Obie is a friend and fellow cabooser, and someone I have a lot of respect for. I just want to get that out of the way so that no one can say I'm shilling for his book on the sly. But I'm glad I can give him a good review with a clear conscience. Anyway, back to the review.
The first thing you'll notice about The Rails Way is that it is simply enormous. At over 900 pages it is nearly twice the size of Agile Web Development with Rails. Quantity has a quality all its own, and the volume of this volume gives Obie room to go seriously in depth into just about every interesting aspect of Rails development. The size of the book makes doing a chapter-by-chapter analysis impractical. It even made doing a full read-through too daunting for me to attempt. So I did the review by reading a couple select chapters, then using the book as a reference for a couple weeks. Anytime I wanted to look something up in the API I used The Rails Way instead. There were a few odd corners of the API that weren't covered, but in general for everything I had to look up, the book had some useful information for me. That says something about its breadth. But it goes deep too. Obie doesn't just mention a feature and brush you off with a brief description of the API. He talks about the feature, puts it in context, sometimes talks about its history and evolution, says how you should use it, how you shouldn't use it, and when there is a better alternative. It's sort of like being tutored by a Rails expert with logorrhea (but in a good way).
As I said, an analysis of each chapter would be more than I can manage here, but the table of contents itself will give you an idea of the ambitious scope of the book:
- Rails Environments and Configuration
- Working with Controllers
- REST, Resources and Rails
- Reflecting on Rails Routing
- Working with ActiveRecord
- ActiveRecord Associations
- ActiveRecord Validations
- Advanced ActiveRecord
- All About Helpers
- AJAX on Rails
- Session Management
- Login and Authentication
- XML and ActiveResource
- RSpec on Rails
- Extending Rails with Plugins
- Rails Production Configurations
- Background Processing
- Appendix A: ActiveSupport API Reference
- Appendix B: Rails Essentials (plugins and other tools)
You can see that the topics include things that aren't part of Rails itself, but things that everyone needs to do with Rails. It also documents parts of Rails that aren't well-documented anywhere else. Talk about exhaustive, I'm tired just from looking at that list of chapters.
The second thing you may notice is the cheery yellow stamp on the cover that says, "Covers Rails 2.0". Obie's been working on this book for ages, but somehow he managed to time it to hit the shelves within a week or two of the release of Rails 2 itself. I'm sure keeping up with all the changes and occasional API flailing was a major challenge, but it's great to have a thorough treatment of Rails that will have some staying power. Of course, Rails is a fast-moving target, so there are some details that will need to be corrected in the second printing. But don't let that stop you from getting the book now; it's worth it even with the minor blemish here and there. And if you're worried stuff might not get corrected, just take a look at the bug tracking site for the book - they are on top of it!
Speaking of corrections, if you have a copy of the first printing (which would be everyone who has the book right now), the epigraphic quote by me at the start of Chapter 7 should say "reify" instead of "rarefy". Which is a nice segue into my next observation. The biggest strength of Rails is the community of people who use and contribute to it. So it's appropriate that Obie has invited some well-known Rails developers to contribute material to his book. He also has included many relevant quotes and commentaries from various developers (including a couple from yours-truly) and references to supporting software and writings. This strengthens the book in two ways. It adds important information, and it connects Rails to its ecosystem. As anyone who has gotten into Rails knows, trying to learn and use Rails in a vacuum is pointless. Learning about the people in the community and the extras that make Rails even more useful can be just as important as learning the API.
I'd like to say more about this book, but I think I've hit all the important points. I'll close by saying that on top have having a ton of information, The Rails Way is very well-written. It's well-organized, nicely structured, and the text itself is very readable. And the persnickety editor in me is even satisfied with the index.
Go get yourself a copy of The Rails Way and have fun upgrading to Rails 2.