Fork me on GitHub

Book Cover


Upgrading to Rails 4 covers each change and guides you through the tweaks you'll need to make for a smooth upgrade.

New Features

Upgrading to Rails 4 covers the features you'll want to be aware of when modernizing existing applications.

Common Upgrading Scenarios

Upgrading to Rails 4 covers specific scenarios you may encounter with upgrading and what to do when come across them.


.pdf, .epub, .mobi (DRM-free)

Download on GitHub

If you found the book useful, please consider donating $15 or more to CFY.

Topics Covered

  • Upgrade walkthrough and checklists
  • Removal of Rails 2 style plugins
  • Deprecation of Rails 2 finder syntax (e.g., find(:all))
  • Changes to routing: applications that use match may be affected
  • Deprecation of certain dynamic finders (e.g., find_all_by_...)
  • Deprecation of eager-evaluated scopes
  • Changes to ActiveRecord::Relation: #all, #includes, and #order
  • Removal of whiny nils
  • Security improvements when using validates_format_of
  • Extraction of the ActiveRecord Session Store
  • Extraction of action caching and page caching
  • Extraction of activeresource
  • Image assets in lib/ and vendor/ are no longer automatically precompiled
  • Changes to cross-site request forgery protection with AJAX (remote) forms


  • Turbolinks introduction and usage
  • Thread-safe by default: how to upgrade and what to look out for
  • Improvements to ActiveRecord associations
  • Introduction of model and controller concerns: app/models/concerns and app/controllers/concerns
  • Introduction of strong_parameters as an alternative to attr_accessible and attr_protected
  • Support for the PATCH verb
  • Routing concerns
  • ActionController::Live for live streaming
  • Russian doll caching
  • Declarative ETags for caching
  • Encrypted cookies
  • Binaries are generated in bin/ and checked into source control (bin/rails and bin/rake)
  • New default test directory structure (test/models, test/controllers, etc...)


The source code for the book is open source. After purchasing the book, you'll periodically receive updates (via email) as new content is contributed.

rails4_upgrade gem

Some chapters in the book use the rails4_upgrade gem, a free/open-source project I started to make certain elements of the upgrade process easier. Check it out and let me know what you think.


Thanks to these folks who are looking over the book's content for technical accuracy and overall flow:

Who is the author?

I'm Andy Lindeman. My day job has me work with Rails on a daily basis. I also help to maintain rspec—a popular testing framework—and its Rails' helpers, rspec-rails.

I gave a widely viewed presentation for the Atlanta Ruby Users Group entitled Rails 4 Whirlwind Tour.

I'd love to hear from you. You can email me, follow me on Twitter, and watch me on GitHub.