Sha256: 01ae7c20957d770abe40232552782e1f27ccbe79becd49cd63f48386bdcc712c

Contents?: true

Size: 485 Bytes

Versions: 5

Compression:

Stored size: 485 Bytes

Contents

class ItemsController < ApplicationController
  def index
    @items = Item.all
  end

  def new
    @item = Item.new
  end

  def create
    @item = Item.new(params[:item])
    if @item.save
      redirect_to items_path
    else
      render :new
    end
  end

  def edit
    @item = Item.find(params[:id])
  end

  def update
    @item = Item.find(params[:id])
    if @item.update_attributes(params[:item])
      redirect_to items_path
    else
      render :edit
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
token_field-1.1.0 spec/dummy/app/controllers/items_controller.rb
token_field-1.0.1 spec/dummy/app/controllers/items_controller.rb
token_field-1.0.0 spec/dummy/app/controllers/items_controller.rb
token_field-0.0.3 spec/dummy/app/controllers/items_controller.rb
token_field-0.0.2 spec/dummy/app/controllers/items_controller.rb