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