ActiveResource Gem Extraction [Rails 4 Countdown to 2013]

Posted on

This post is part of a series of 31 Rails 4 articles being released each day in December 2012.

The purpose of ActiveResource is to map RESTful resources as models in your Rails applications. However, it is one component of Rails that hasn't received much attention over the years. With great gems such as faraday and various others specializing in encapsulating APIs, ActiveResource has not been the tool of choice for consuming APIs.

As of Rails 4, ActiveResource has been extracted to a gem named activeresource. Since the extraction, development for ActiveResource has been reinvigorated. A small team, lead by Jeremy Kemper, is now adding new features to ActiveResource. For example, there is now basic support for associations with ActiveResource models. Be sure to read ActiveResource is dead, long live ActiveResource, as it goes into details about some of the new additions.

Upgrade Path

If your Rails 3 application is dependent on ActiveResource models, add the activeresource gem to your Gemfile to ensure a seamless upgrade:

gem 'activeresource', require: 'active_resource'

Further Reading


This post is by Kevin Faustino. Kevin is the Chief Craftsman of Remarkable Labs and also the founder of the Toronto Ruby Brigade.


comments powered by Disqus