| Class | FirmController |
| In: |
app/controllers/firm_controller.rb
|
| Parent: | ApplicationController |
# File app/controllers/firm_controller.rb, line 46
46: def administer
47: @firm = Firm.find( params[:id] ) # XXX .check_permission!( :administer )
48: if request.post?
49: @firm.attributes = params[:firm]
50: if @firm.save
51: redirect_to :action => 'administer', :id => @firm
52: end
53: end
54: end
# File app/controllers/firm_controller.rb, line 26
26: def index
27: @new_firm = Firm.new
28: if request.post?
29: if params[:create]
30: @new_firm.attributes = params[:new_firm]
31: if @new_firm.save
32: redirect_to :action => 'index'
33: end
34: elsif params[:destroy]
35: params[:destroy].each do |id, val|
36: Firm.find(id.to_s).destroy
37: redirect_to :action => 'index'
38: end
39: elsif params[:administer]
40: redirect_to :action => 'administer',
41: :id => params[:administer].keys.first.to_i
42: end
43: end
44: end