Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Rails Recipes
Table of Contents
What Readers Are Saying About Rails Recipes, Rails 3 Edition
Introduction
What Makes a Good Recipe Book?
Who’s It For?
Rails Version
Resources
Acknowledgments
Part 1: 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
Nest has_many :through Relationships
Keep Your Application in Sync with Your Database Schema
Seed Your Database with Starting Data
Use Helpers in Models
Avoid Dangling Database Dependencies
Part 2: 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
Part 3: 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
Cache Local Data with HTML5 Data Attributes
Part 4: Testing Recipes
Automate Tests for Your Models
Test Your Controllers
Test Your Helpers
Test Your Outgoing Mailers
Test 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
Part 5: Email Recipes
Send Gracefully Degrading Rich-Content Emails
Send Email with Attachments
Test Incoming Email
Part 6: 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
Part 7: 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 Plugin
Bibliography
You May Be Interested In…
← Prev
Back
Next →
← Prev
Back
Next →