The Ruby on Rails Tutorial for Rails 4.0 (beta)

Mar 20, 2013 • posted by Michael Hartl

tl;dr: A Rails 4.0–compatible version of the Ruby on Rails Tutorial book is now available online. Sales of the ebook and a supplementary screencast will start after the final version of Rails 4.0 is released (available at a large discount to current customers). A new third edition is planned for later this year (with upgrade discounts for current customers). Subscribe to get email notifications of future announcements.

I’m pleased to announce the availability of a full draft of the Ruby on Rails Tutorial book updated for Rails 4.0. Changes include updates to all relevant gems, the use of some newer features of Capybara, new-style scopes, updated Active Record finders, and coverage of the new strong parameters feature to prevent mass assignment vulnerabilities. Previous versions have benefited tremendously from the book’s many eagle-eyed readers, so please email me with any typos or bugs you find in the new version.

Warning: Rails 4.0 is currently in beta, and this is bleeding-edge stuff, so you may get cut. For example, as of this writing Spork doesn’t work with Rails 4. To work around this, the Gemfile in the book pulls directly from a fork I made of a repository that fixes the issue (and whose pull request hasn’t yet been accepted). Another example, needed to work around changes in Capybara, is to pull the XPath and Capybara libraries directly from the latest master branches on GitHub, which introduces a significant risk of instability. And there are surely other examples ready to surprise the unwary.

Once the situation has stabilized a bit, I plan to make a short supplementary screencast highlighting the relevant changes and showing how the sample app works with Rails 4. When that happens, I will make sales of the Rails 4 version ebooks (PDF/EPUB/MOBI) available as well.

Once I feel the changes in Rails justify the effort, I plan to release a complete revision with a new screencast series. That will involve some more extensive changes, including the incorporation of a new spec syntax supported by the latest version of RSpec (so-called feature specs). I expect this to happen some time later this year.

To get future announcements delivered to your inbox, subscribe to get email notifications. (Google apparently doesn’t believe in RSS, but I do, so you can also subscribe to the news feed.)

MORE ARTICLES LIKE THIS: