It’s Been A Long Climb – What’s New in Rails 3.1?

Only when you stop and look down do you see how high you’ve climbed (Photo: Seier)

The latest version of the web framework ruby on rails is slated for an August 22nd release. This much anticipated version comes just one year since the major rewrite involving Rails merging with Merb to give us Rails 3.

What’s new in Rails 3.1?

Currently in release candidate 4, Rails 3.1 will ship out of the box with jQuery, SASS and CoffeeScript. Also, a bunch of new conventions and features have been added such as the Asset Pipeline, HTTP Streaming and Mountable Engines to name a few.
These are just some things to familiarize yourself with as we get closer to the full release.

The Asset Pipeline

One of the most talked about features is the new asset pipeline powered by Sprockets 2.0. There will now be a new directory in our rails apps where our assets will reside. Assets here refer to the sylesheets, javascript and image files.  Sprockets is an asset packaging system that concatenates and serves the stylesheets and javascript. This is a major attempt to help with issues programmers have been having regarding organising these files, especially in large apps and also in engines and plugins. It is here in the asset pipeline where sass/scss becomes our default for css and coffeescript the default for javascript.

HTTP Streaming

A serious attempt is being made by the Rails core team to get our webpages loaded faster and that is what HTTP Streaming used in Rails 3.1 hopes to accomplish. Essentially this allows the browser to secure the necessary assets (javascript, stylesheets and images) while the server is generating a response. This results in faster pages which makes your users happy and we all want happy users! I have linked to quite a few resources that go into depth about this topic at the end of this post.

Mountable Engines

Recall that Rails Engines are basically mini rails apps that can live inside a larger more complex rails application. An engine can have its own models, views, controllers, generators and publicly served static files, just to name a few of its current capabilities.
In addition to that engines will now be capable of having their own routing and helper scope and will also be able to access and take advantage of the new asset pipeline.

These are just some of the many improvements that are being jam packed into the new release. For more information on Rails 3.1 and the changes involved I recommend the following articles and screencasts.

Share

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.