New Features in Ruby on Rails 5

If you're a Ruby on Rails developer, you are probably excited about Rails 5 as we are here at ANTLR Interactive. Every 2 years, the Rails team has put together an amazing major release with a bunch of new features and it's always a good time. Some of the features can be controversial (Turoblinks, Asset Pipeline) but more often than not, the features that have been added or things that have been changed are highly welcomed and help a lot when developer an application.

A few months back, DHH gave a talk at Rails Conf about Ruby on Rails 5 and some of the new features and told everyone that it was slated for release Fall of 2015.

Let's drive into some of the new features in Rails 5!

Major Ruby on Rails 5 Improvements

Rails API

One of the most significant features that is being added to Rails 5 is the addition of the rails-api gem into the core of Rails. Over the last few years, many Single Page Application (SPA) frameworks have been developed and backend frameworks have had to adapt to die. Many MVC frameworks have since included an API package such as WebAPI for .Net. For the longest time, Rails hasn't had a default way to build an API and many open source developers in the ruby community have worked hard to build the rails-api gem and many developers in the community use this gem for their Rails API backend projects.

Because of this attention, in Rails 5, the rails-api gem will be merged into the core allowing for developers to build easy JSON APIs easily and fast.

rails api

Turoblinks 3

One of the more controversial additions to Rails 4 was the addition of Turoblinks. Turoblinks was first introduced to provide competition for SPA frameworks like BackboneJS and AngularJS. The goal was to provide an easy framework to build SPAN-like applications but keep the ease that Rails gives the developer (all the helpers, the cache, etc).

In general, Turbolinks is great. We actually use it at ANTLR Interactive for a lot of our Rails applications. There are sometimes some strange things that happen, but overall it works great for a SPA-esque feel.

Turbolinks 3 aims to bring even more flexibility when building your Turbolinks enabled Rails applications. Instead of reloading an entire page of an application, Turoblinks 3 will give the developer the ability to instead load selective partials that have updated.

turbolinks 3

Action Cable

The last major feature that Rails 5, is a feature called Action Cable. A lot of projects use some kind of WebSocket component and browser support has increased to a point where these projects can use WebSockets with no fear. In response to this, backend technologies have to adapt and also develop libraries that implement this technology (SignalR uses it in the .Net stack). Action Cable is the Rails solution for the implementation of WebSocket.

Wrapping Up

It seems that there is an interesting pattern for the Rails 5 release and it seems to be focused around Javascript and the client. The web landscape has changed a lot over the last few years and have shifted focus from a server heavy application to a client centric application. For Rails to keep up, changes had to be made and Rails 5 seems like it will successfully keep up with the ever changing marketplace.