Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 18th, 2012  |  syntax: None  |  size: 0.30 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. class ItemsController < ApplicationController
  2.   // To notify Rails that we are capable of handling xml and json request
  3.   respond_to : xml, :json
  4.  
  5.   // To notify that this controller behave as a Restfulie controller
  6.   acts_as_restfulie
  7.  
  8.   def index
  9.     @items = Item.all
  10.     respond_with @items
  11.   end
  12. end