Pragmatic Programmers, LLC, 2012. - 296 pages. 2nd edition, ISBN13: 978-1934356777
Database Recipes.
Create Meaningful Many-to-Many Relationships.
Create Declarative Named Queries.
Connect to Multiple Databases.
Set Default Criteria For Model Operations.
Add Behavior to Active Record Associations.
Create Polymorphic Associations.
Version Your Models.
Perform Calculations on Your Model Data.
Use Active Record Outside of Rails.
Connect to Legacy Databases.
Make Dumb Data Smart with composed_of().
DRY Up Your YAML Database Configuration File.
Use Models Safely in Migrations.
Create Self-referential Many-to-Many Relationships.
Protect Your Data From Accidental Mass-Update.
Create a Custom Model Validator excerpt.
Nest has_many :through Relationships.
Keep Your Application In Synch With Your Database Schema.
Seed Your Database with Starting Data.
Use Helpers in Models.
Avoid Dangling Database Dependencies.
Controller Recipes.
Create Nested Resources.
Create a Custom Action in a REST Controller.
Create a Helper Method to Use In Both Controllers And Views.
Trim Your REST Resources.
Constrain Routes by Subdomain (and Other Conditions).
Add Web Services to Your Actions.
Write Macros.
Manage a Static HTML Site with Rails.
Syndicate Your Site with RSS.
Set Your Application’s Home Page.
User Interface Recipes.
Create a Custom Form Builder.
Pluralize Words on the Fly (or Not).
Insert Action-Specific Content in a Layout.
Add Unobtrusive Ajax with jQuery.
Create One Form for Many Models excerpt.
Cache Local Data with HTML 5 Data Attributes excerpt.
Testing Recipes.
Automate Tests for Your Models.
Test Your Controllers.
Test Your Helpers.
Test Your Outgoing Mailers.
Testing Across Multiple Controllers.
Focus Your Tests With Mocking and Stubbing.
Extract Test Fixtures from Live Data.
Create Dynamic Test Fixtures.
Measure and Improve Your Test Coverage.
Create Test Data With Factories.
Email Recipes.
Send Gracefully Degrading Rich-Content Emails.
Send Email with Attachments.
Test Incoming Email.
Big-Picture Recipes.
Roll Your Own Authentication.
Protect Your Application With Basic HTTP Authentication.
Authorize Users with Roles.
Force Your Users to Access Site Functions with SSL.
Create Secret URLs.
Use Rails without a Database.
Create Your Own Ruby Gem.
Use Bundler Groups to Manage per-Environment Dependencies.
Package Rake Tasks for Reuse with a Gem.
Explore Your Rails Application with the Console.
Automate Work with Your Own Rake Tasks.
Generate Documentation for Your Application.
Render Application Data as Comma-Separated Values.
Debug and Explore Your Application with the ruby-debug Gem.
Render Complex Documents as PDFs.
Extending Rails.
Support Additional Content Types with a Custom Renderer.
Accept Additional Content Types with a Custom Parameter Parser.
Templatize Your Generated Rails Applications.
Automate Recurring Code Patterns with Custom Generators.
Create a Mountable Application as a Rails Engine Plug-In.