Archive RSS Email

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.)

Michael Hartl

I’m Michael Hartl—author, educator, and entrepreneur. I’m probably best known as the creator of the Ruby on Rails Tutorial, a book and screencast series that together constitute one of the leading introductions to web development. Once called his “favorite book” by Wikipedia founder Jimmy Wales, the Ruby on Rails Tutorial currently has over 150 5-star reviews at Amazon. I’m also (in)famous for creating Tau Day and The Tau Manifesto, which have inspired an international movement dedicated to the proposition that “pi is wrong.” (For example, as a result of The Tau Manifesto, MIT releases their admissions decisions each year at “Tau Time” (6:28 p.m.), and typing tau/2 at Google yields 3.14159…) Finally, I’m a founder of Softcover, a publishing system and sales platform for technical authors, which among other things powers both The Tau Manifesto and the Ruby on Rails Tutorial.

I’m a graduate of Harvard College and have a Ph.D. in Physics from Caltech, where I studied black hole dynamics and was an award-winning instructor in theoretical and computational physics. I’m also an alumnus of Y Combinator, the entrepreneur program that has produced companies such as Dropbox and Airbnb. (Alas, my own Y Combinator startup was neither Dropbox nor Airbnb.)