Giter Club home page Giter Club logo

restfulie's Introduction

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
end

Now let’s handle them all:

def index
  respond_with @orders = Order.all
end

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|
  order.link "payment", payment_url(order)
end

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 = Restfulie.at('http://localhost:3030/orders').get
puts response.code

orders = response.resource
response = orders.link(payment).follow.post {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!

Installing

Execute:

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

Contributions

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.

restfulie's People

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.