Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


The Ruby on Rails Application Development Bible

Ruby on Rails strips complexity from the development process, enabling professional developers to focus on what matters most: delivering business value via clean and maintainable code. This book is the only comprehensive, authoritative guide to delivering production-quality code with Rails 3. Pioneering Rails expert Obie Fernandez and a team of leading experts illuminate the entire Rails 3 API, along with the idioms, design approaches, and libraries that make developing applications with Rails so powerful. Drawing on their unsurpassed experience and track record, they address the real challenges development teams face, showing how to use Rails 3 to maximize your productivity.

Using plentiful detailed code examples, Obie systematically covers Rails 3 key capabilities and subsystems, making this book a reference that you will refer to again and again. He presents advanced Rails programming techniques that have been proven effective in day-to-day usage on dozens of production Rails systems and offers important insights into behavior-driven development and production considerations such as scalability. Dive deep into the Rails 3 codebase together, discovering why Rails is designed the way it is— and how to make it do what you want it to do.

This book will help you

  • Learn what’s new in Rails 3

  • Increase your productivity as a web application developer

  • Realize the overall joy in programming with Rails

  • Leverage Rails’ powerful capabilities for building REST-compliant APIs

  • Drive implementation and protect long-term maintainability using RSpec

  • Design and manipulate your domain layer using Active Record

  • Understand and program complex program flows using Action Controller

  • Master sophisticated URL routing concepts

  • Use Ajax techniques via Rails 3 support for unobtrusive JavaScript

  • Incorporate logins and authentication into your application

  • Extend Rails with the best third-party plug-ins and write your own

  • Integrate email services into your applications with ActionMailer

  • Choose the right Rails production configuration

  • Streamline deployment with Capistrano

  • Improve application responsiveness with background processing

  • Create your own non-Active Record domain classes using Active Model

  • Master Rails’ utility classes and extensions in Active Support

Subscriber Reviews

Average Rating: 4.615384615384615 out of 5 rating Based on 13 Ratings

"The Rails3 Way, Second Edition" - by CraigPayne on 12-JUL-2013
Reviewer Rating: 1 star rating2 star rating3 star rating4 star rating5 star rating
The more I use this book, the more useful I think it becomes.  Examples are very good - and I've found multiple problems in my own code by comparison to the examples.  The layout is great.

If a future revision comes out, examples with the newer syntax ( replacing  :a => b with a: b) would be nice to have.

Thank you so much.  This is my 'bible' for Rails.


Report as Inappropriate

"Way to go, Obie!" - by Nithin on 14-MAR-2011
Reviewer Rating: 1 star rating2 star rating3 star rating4 star rating5 star rating
Often enough in the Rails community you hear people saying that following the Rails way of doing things will make life much easier. As the title suggests, this is the book that teaches you how to develop Rails 3 applications in “the Rails way”.

This book is not for beginners. Readers should at least know how Rails works, and preferably even have developed one or two applications as well. The book is organized in the form of a reference, and so if you’re looking for a step by step tutorial, you will be disappointed.

On the other hand, readers who already can develop Rails applications would find this a very interesting book to read. I wasn’t expecting that I would be able to read this book from beginning to end, but I did manage that, although with the amount of information in the book, I can hardly remember a tenth of what I read.

Like Rails, this book is highly opinionated. You will be told that Rspec is the Rails way to test, and that Haml is the Rails way of writing templates, even though Test::Unit and erb templates are the Rails default. In fact, there’s an entire chapter dedicated to Rspec and all the view examples use Haml and not erb. Those who use erb for templates might find the Haml examples a tad distracting.

The content of the book is arranged like this:

The first chapter discusses Rails configurations (bundler, dveleopment/test/production environment etc.) and is followed by a chapter on routing. It’s mostly plain reference so far, telling you what and how Rails works and how to set up your application. The third chapter, on REST and its implementation in Rails, is where this book really started getting my attention. This chapter will tell you all you need to know about why REST is such a big deal in Rails.

Chapters 4 through 9 cover the M and C of Rails MVC — the models and the controllers. ActiveRecord is covered in great depth and the chapter on advanced ActiveRecord is amazing. Reading the section on single table inheritance left me despairing about the awkward ways in which I used to handle ActiveRecord objects that would have been better off being split off into subclasses referring to the same table.

Chapters 10-12 cover the V of MVC – the views and helpers and a chapter on Ajax on Rails. This part too is one that you might use more as a reference than as read-on-the-train-to-work material. Especially the chapter on helpers is rather dry, and Obie himself mentions that it is reference material. In fact, the different helper modules are even arranged alphabetically.

Chapter 13 is on sessions management, and is followed by a chapter covering Authlogic and Devise – the two most popular authentication plugins for Rails. Since Rails doesn’t have a built in authentication system, a quick look at the two most popular plugins makes a lot of sense.

Chapters 15-16 cover ActiveResource and ActionMailer respectively. Frankly, I never really got what ActiveResource is all about, and I’m afraid I still haven’t got the eureka moment after reading this book.

These are followed by a chapter on caching and performance, and one on the testing framework, Rspec — both incredibly useful chapters. The former explains how to use builtin mechanisms in Rails to improve performance and the latter gives a quick introduction to Rspec. Chapter 19 covers Rails plugins and chapter 20 is about background processing in Rails – specifically Delayed Job, Resque, and rails runner.

This 700+ page book covers the Rails framework comprehensively (although it does skip ERB and Test::Unit completely). Like its predecessor The Rails Way for earlier versions of Rails, this book will be one that you will find most Rails developers referring to and quoting over the next few years.

Are there any negatives about this book? I should point out once again that this is mainly a reference for the framework, so some chapters might seem dry if you’re reading cover to cover. (I should also point out that these are the very chapters that you will be turning to when you desperately need reference for how to do something.) For instance, the chapter on helpers should certainly have been cut short and the majority of the content moved to the appendix. But on the whole, I have very few complaints about the book.

So who should buy this book? If you’re completely new to Rails, don’t buy now. (Or even better, buy it but read it after you’ve read an introductory book on Rails.) Newcomers will easily be overwhelmed with the in-depth coverage of Rails and the lack of example apps to work on while learning.

That doesn’t mean that beginner level Rails programmers won’t find this book useful. I’m only saying that this wouldn’t be the best book when you’re looking at Rails for the first time. If you have some understanding of Rails, even if it is only one or two toy apps, this book will help you make big leaps in productivity. And experienced Rails programmers will obviously find the exhaustive coverage of Rails very useful.

Report as Inappropriate

"One of the best Rails 3 books available" - by salbito on 03-JAN-2011
Reviewer Rating: 1 star rating2 star rating3 star rating4 star rating5 star rating
This is an outstanding book although at times very opionated. The book is jam packed with information which is quickly accessible. It is opionated in that at times i throws it preference and ignores the rest. Haml over Erb and Rspec over Test::Unit. But I guess that should be expecting with a book titled "The Rails 3 Way"
Report as Inappropriate

Table of Contents

 Index  •  Method Index