We're working on something new! Hook Relay gives you Stripe-quality webhooks in minutes. Sign up for free today! Check out Hook Relay

What everybody ought to know about Ruby on Rails 4.1

One of the most important things to know about Rails 4.1 is that even the beta version is stable enough for some companies to use it in production. 

One of the most important things to know about Rails 4.1 is that even the beta version is stable enough for some companies to use it in production. For example,Basecamp began Rails 4.1 beta1. Other important features from the release notes include the Spring application preloader, changes to config/secrets.yml, Action Pack variants, and Action Mailer previews. You can find the full list of changes by reviewing the list of commits in the GitHub repository for Rails.

Spring application preloader

In previous versions of Rails you would need to setup Spring if you wanted to keep your applications active between tests, rake tasks, and migrations. Not having Spring, your applications would need to boot for each of these events. When Spring was configured, the development process was sped up because the application would stay running in the background. Now, in Rails 4.1, new applications will automatically take advantage of Spring to speed up development and keep your application running in the background.


In the config folder of Rails 4.1, you will now find a secrets.yml file. This is used to manage the secret_key_base for your application. Additionally, this file can be used to store other keys like the ones used for external APIs.

Action Pack variants

Depending on the devices accessing your application, you may want to render different HTML, XML, or JSON. This allows you to configure your app to look great on different devices like tablets, phones, and laptops. The variant can be set in a before_action and your app can respond to variants in the same way it responds to formats. You will also need to provide templates for each variant and format.

Action Mailer previews

Creating an Action Mailer was cumbersome in previous versions of Rails. Previously, you would need to send test emails to see what was being delivered to a client and to get the formatting right. Now, in Rails version 4.1, you can use Action Mailer previews to see what an email will look like by visiting a special URL. By default, these are located at test/mailers/previews, but that can be changed with the preview_path during configuration.

Honeybadger has your back when it counts. We're the only error tracker that combines exception monitoring, uptime monitoring, and cron monitoring into a single, simple to use platform.

Our mission: to tame production and make you a better, more productive developer. Learn more

author photo

Starr Horne

Starr Horne is a Rubyist and Chief JavaScripter at Honeybadger.io. When she's not neck-deep in other people's bugs, she enjoys making furniture with traditional hand-tools, reading history and brewing beer in her garage in Seattle.

“We’ve looked at a lot of error management systems. Honeybadger is head and shoulders above the rest and somehow gets better with every new release.”
Michael Smith
Try Error Monitoring Free for 15 Days