1 class BitemController < 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 @bitem_pages, @bitems = paginate :bitems, :per_page => 10
16 @bitem = Bitem.find(params[:id])
24 @bitem = Bitem.new(params[:bitem])
26 flash[:notice] = 'Bitem was successfully created.'
27 redirect_to :action => 'list'
29 render :action => 'new'
34 @bitem = Bitem.find(params[:id])
38 @bitem = Bitem.find(params[:id])
39 if @bitem.update_attributes(params[:bitem])
40 flash[:notice] = 'Bitem was successfully updated.'
41 redirect_to :action => 'show', :id => @bitem
43 render :action => 'edit'
48 Bitem.find(params[:id]).destroy
49 redirect_to :action => 'list'