Sha256: 4a1c3f06cbab5dbffb2043db869b2739480f22a21892670962f7fd6c7a3e97ce

Contents?: true

Size: 354 Bytes

Versions: 15

Compression:

Stored size: 354 Bytes

Contents

class ItemsController < ApplicationController
  
  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

Version data entries

15 entries across 5 versions & 2 rubygems

Version Path
restfulie-nosqlite-1.0.4 full-examples/rest_from_scratch/part_1/app/controllers/items_controller.rb
restfulie-nosqlite-1.0.4 full-examples/rest_from_scratch/part_3/app/controllers/items_controller.rb
restfulie-nosqlite-1.0.4 full-examples/rest_from_scratch/part_2/app/controllers/items_controller.rb
restfulie-1.1.1 full-examples/rest_from_scratch/part_2/app/controllers/items_controller.rb
restfulie-1.1.1 full-examples/rest_from_scratch/part_1/app/controllers/items_controller.rb
restfulie-1.1.1 full-examples/rest_from_scratch/part_3/app/controllers/items_controller.rb
restfulie-1.1.0 full-examples/rest_from_scratch/part_3/app/controllers/items_controller.rb
restfulie-1.1.0 full-examples/rest_from_scratch/part_1/app/controllers/items_controller.rb
restfulie-1.1.0 full-examples/rest_from_scratch/part_2/app/controllers/items_controller.rb
restfulie-nosqlite-1.0.3 full-examples/rest_from_scratch/part_2/app/controllers/items_controller.rb
restfulie-nosqlite-1.0.3 full-examples/rest_from_scratch/part_1/app/controllers/items_controller.rb
restfulie-nosqlite-1.0.3 full-examples/rest_from_scratch/part_3/app/controllers/items_controller.rb
restfulie-1.0.3 full-examples/rest_from_scratch/part_3/app/controllers/items_controller.rb
restfulie-1.0.3 full-examples/rest_from_scratch/part_2/app/controllers/items_controller.rb
restfulie-1.0.3 full-examples/rest_from_scratch/part_1/app/controllers/items_controller.rb