Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guilhermesilveira/430868 to your computer and use it in GitHub Desktop.
Save guilhermesilveira/430868 to your computer and use it in GitHub Desktop.
class ItemsController < ApplicationController
include Restfulie::Server::ActionController::Base
respond_to :xml, :json
def index
@items = Item.all
respond_with @items
end
def create
@item = Item.create(params[:item])
render :text => "", :status => 201, :location => item_url(@item)
end
def show
@item = Item.find(params[:id])
respond_with @item
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment