1 class MerchandiseController < ApplicationController
4 render :action => 'list'
7 # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
8 verify :method => :post, :only => [ :destroy, :create, :update ],
9 :redirect_to => { :action => :list }
12 @merchandise_pages, @merchandises = paginate :merchandises, :per_page => 10
16 @merchandise = Merchandise.find(params[:id])
20 @merchandise = Merchandise.new
24 @merchandise = Merchandise.new(params[:merchandise])
26 flash[:notice] = 'Merchandise was successfully created.'
27 redirect_to :action => 'list'
29 render :action => 'new'
34 @merchandise = Merchandise.find(params[:id])
38 @merchandise = Merchandise.find(params[:id])
39 if @merchandise.update_attributes(params[:merchandise])
40 flash[:notice] = 'Merchandise was successfully updated.'
41 redirect_to :action => 'show', :id => @merchandise
43 render :action => 'edit'
48 Merchandise.find(params[:id]).destroy
49 redirect_to :action => 'list'