Facilitating the spread of knowledge and innovation in professional software development



Choose your language

InfoQ Homepage News Rails 4.1 Improves Boot Time and Responsive Layouts

Rails 4.1 Improves Boot Time and Responsive Layouts

Lire ce contenu en français


After two release candidates, the Rails team has just released Rails 4.1.0. The point release is meant to signify that the changes are backwards-compatible and upgrading should be painless.

Rails 4.1 includes Spring (no relation to the JVM application framework) to speed up development by preloading your application: "With Spring, your application is a persistent process that can be reused across commands, so only the first run is slow. And we automatically detect code changes, and reload just those parts". After a simple setup, your rake and rails commands will take advantage of the preloading.

In today's mobile world, websites should respond to different screen form-factors. Action Pack Variants helps you render different templates depending on the user's device category, like how you can already respond with different file formats: 

respond_to do |format|
  format.html do |html|
    html.tablet # renders app/views/projects/show.html+tablet.erb { extra_setup; render ... }

Basecamp has been using this technique to serve desktop browsers, mobile browsers and native mobile apps from a single Rails application.

Rails 4.1 also brings new features to some of its components: Active Record now supports Enums that are mapped to simple integer values in the database. Action Mailer has gained support for previewing email templates in the browser, instead of having to deliver them to get a preview.

To improve the security of your applications, the keys and tokens your application needs can now be stored at a central place in config/secrets.yml.

If you plan to upgrade your application, have a look at the migration guide that gives you detailed instructions on all the new features. And even though it's a minor release, there were some removals, so make sure to check them before upgrading. To learn more about all the new features, have a look at Godfrey Chan's blog post.

We need your feedback

How might we improve InfoQ for you

Thank you for being an InfoQ reader.

Each year, we seek feedback from our readers to help us improve InfoQ. Would you mind spending 2 minutes to share your feedback in our short survey? Your feedback will directly help us continually evolve how we support you.

Take the Survey

Rate this Article


Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p


Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.