Rails 3 is a huge step forward. You can now easily extend the framework, change its behavior, and replace whole components to bend it to your will, all without messy hacks. This pioneering book is the first resource that deep dives into the new Rails 3 APIs and shows you how to use them to write better web applications and make your day-to-day work with Rails more productive.

Everything covered in this book is valid through at least Rails 3.1

For Rails 4, have a look at the second edition.

Buy Now

Select a DRM-free Format:

In Stock
In Stock
In Stock
Buy the eBook and get these DRM-free formats delivered immediately:
  • epub (for iPhone/iPad, Android, eReaders)
  • mobi (for Kindle)
  • PDF
We can automatically send them to your Kindle or Dropbox, and for a social reading experience we can link the book to your Readmill account. (You'll need to log in to enable these options.)
 

About this Book

  • 184 pages
  • Published:
  • Release: P1.0 (2011-03-31)
  • ISBN: 978-1-93435-673-9

Rails Core developer José Valim guides you through seven different tutorials, each of them using test-driven development to build a new Rails extension or application that solves common problems with these new APIs. You will understand how the Rails rendering stack works and customize it to read templates from the database while you learn how to mimic Active Record behavior, like validations, in any other object. You will find out how to write faster, leaner controllers, and you’ll learn how to mix Sinatra applications into your Rails apps, so you can choose the most appropriate tool for the job. In addition, you will improve your productivity by customizing generators and responders.

This book will help you understand Rails 3’s inner workings, including generators, template handlers, internationalization, routing, and responders. With the knowledge you’ll gain, you’ll be ready to tackle complicated projects more easily than ever before, creating solutions that are well-tested, modular, and easy to maintain.

Contents and Extracts

Full Table of Contents

Preface

  • Creating our Own Renderer excerpt
    • Enginex
    • Writing the Renderer
    • Understanding Rails Rendering Stack
    • Taking it to the Next Level
    • Wrapping up
  • Building Models with Active Model
    • Creating Our Model
    • Taking it to the Next Level
    • Wrapping up
  • Retrieving View Templates from Custom Stores
    • Setting up a SqlResolver
    • Configuring our Resolver for Production
    • Serving Templates with Metal
    • Wrapping Up
  • Sending Multipart e-mails with Custom Template Handlers excerpt
    • Playing with the Template Handler API
    • Building a Template Handler with Markdown + ERb
    • Customizing Rails Generators
    • Extending Rails with Railties
    • Wrapping up
  • Subscribing and Publishing Application Events with Rails Engines
    • Storing Notifications in the Database
    • Extending Rails with Engines
    • Rails and Rack
    • Storing Notifications Asynchronously
    • Wrapping up
  • Writing DRY Controllers with Responders and Generators
    • Understanding Responders
    • Exploring ActionController::Responder
    • More Generators Customization
    • Wrapping up
  • Translating applications using Key-Value backends
    • Revisiting Rails::Application
    • I18n Backends and Extensions
    • Rails & Sinatra
    • Taking it to the Next Level with Devise and Capybara
    • Wrapping up

About the Author

José Valim is the lead developer and co-founder of Plataforma Tec. He started working with Ruby and Rails in late 2006 and was invited to be part of the Rails Core Team in 2010 after his work on Rails 3 development. He’s also author and maintainer of various other well-known open source projects that led him to receive a Ruby Hero award in recognition for his contributions to the community. Lately, he’s been flying around the globe giving talks and courses about Ruby and Rails.

Upcoming Author Events

  • 2013-04-27: Brian P. Hogan
    JRuby - Imagine mixing the easy syntax, powerful language features, and rapid development of Ruby with the speed, power, and flexibility of the Java Virtual Machine? Ruby and the JVM go together like chocolate and peanut butter, and you'll see some examp (Twin Cities Code Camp, Minneapolis, MN)
  • 2013-08-13: Brian P. Hogan
    Testing Client Side Code with Jasmine and CoffeeScript With more logic moving from the client-side to the server-side, we've got to get better at testing code. In this talk you'll learn about writing tests for client-side code that help drive the d (ThatConference, Wisconsin Dells, Wisconsin)
  • 2014-04-05: Brian P. Hogan
    Automate with Grunt (Twin Cities Code Camp, Minneapolis, MN)