Skip to content

Instantly share code, notes, and snippets.

@hemalich
Created April 27, 2011 08:10
Show Gist options
  • Save hemalich/943893 to your computer and use it in GitHub Desktop.
Save hemalich/943893 to your computer and use it in GitHub Desktop.
class ItemsController < ApplicationController
// To notify Rails that we are capable of handling xml and json request
respond_to : xml, :json
// To notify that this controller behave as a Restfulie controller
acts_as_restfulie
def index
@items = Item.all
respond_with @items
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment