CRUD through HTTP is a good step forward to using resources and becoming RESTful. Another step further into it is to make use of hypermedia-based services and the Restfulie gem allows you to do it very quickly.
Ruby JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
full-examples removing tokamak for hypertemplate May 19, 2011
lib releasing 1.1.1 Jul 5, 2012
site removing tokamak for hypertemplate May 19, 2011
spec removing ruby-debug Jul 5, 2012
tests fixing extra follow error Feb 7, 2011
.gitignore removing tokamak for hypertemplate May 19, 2011
.gitmodules added restbuy example Dec 23, 2010
Gemfile using simplecov on Ruby 1.9+ Jul 5, 2012
README.textile Update README.textile Nov 23, 2012
Rakefile removed deprecation warnings in Rakefile Jul 31, 2012
init.rb removing copyright notice in files. LICENSE already has this info. Mar 1, 2010
restfulie.gemspec requiring hypertemplate 1.2.2 Jul 5, 2012



Restfulie Ruby is not being actively maintained. Restfulie C# and Java (through VRaptor) support can be found on the mailing list.

Web site

Restfulie’s site has a lot of information on Restfulie itself

Quit pretending

CRUD through HTTP and web services (aka Rest) in Rails is a good step forward to using resources and becoming RESTful, another step further into it is to make use of hypermedia and semantic meaningful media types: this gem allows you to do it really fast. Go go go!

Bite me!

One liners for your pleasure. First, how to let restfulie know which media types you can handle:

class ItemsController < ...
  respond_to :atom, :html, :xml, :commerce, :opensearch

Now let’s handle them all:

def index
  respond_with @orders = Order.all

And what is the first difference between simple web services with Rails and a REST architecture? Let’s add hypermedia to the game:

memeber(@order) do |order| "payment", payment_url(order)

There you go, hypermedia, on the fly. You can also throw in link headers and much more fun for your life when maintaining your services. Lets grab it and navigate!

response ='http://localhost:3030/orders').get
puts response.code

orders = response.resource
response = {creditcard => 4444}

That was it for your first hypermedia introduction with Restfulie. Now its time for the real deal.

Download it, install it, use it, ask questions in the mailing list and read the documentation on Restfulie’s website!



gem install restfulie

For use in Rails 2.3, make sure to require the responders_backport gem in addition to the restfulie gem, either in environment.rb or in the Gemfile.

Building the project

If you want to build the project and run its tests, remember to install all (client and server) required gem.
Bundler is required to easily manage dependencies

bundle install
rake test:spec test:integration


Restfulie was created and is maintained by Caelum, and has received enormous contributions from all those developers:

Project Leader
Guilherme Silveira, Caelum

Caue Guerra, caelum
George Guimaraes, abril and plataforma
Fabio Akita
Diego Carrion
Leandro Silva
Gavin-John Noonan
Antonio Marques
Luis Cipriani, abril
Everton Ribeiro, abril
Paulo Ahagon, abril
Elomar França
Thomas Stefano
David Paniz
Caike Souza

Rails 2

If you want to use Restfulie with Rails2, please use any release up to 0.9.2 and its minor releases.