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