Class: Groseillier::AdministratorsController
- Inherits:
-
AdminController
- Object
- ApplicationController
- AdminController
- Groseillier::AdministratorsController
- Defined in:
- app/controllers/groseillier/administrators_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
25 26 27 28 29 30 |
# File 'app/controllers/groseillier/administrators_controller.rb', line 25 def create @administrator = Administrator.new(params[:administrator]) @administrator.save respond_with @administrator end |
#destroy ⇒ Object
41 42 43 44 45 46 |
# File 'app/controllers/groseillier/administrators_controller.rb', line 41 def destroy @administrator = Administrator.find(params[:id]) @administrator.destroy respond_with @administrator end |
#edit ⇒ Object
21 22 23 |
# File 'app/controllers/groseillier/administrators_controller.rb', line 21 def edit @administrator = Administrator.find(params[:id]) end |
#index ⇒ Object
3 4 5 6 7 |
# File 'app/controllers/groseillier/administrators_controller.rb', line 3 def index @administrators = Administrator.scoped respond_with @administrator end |
#new ⇒ Object
15 16 17 18 19 |
# File 'app/controllers/groseillier/administrators_controller.rb', line 15 def new @administrator = Administrator.new respond_with(@administrator) end |
#show ⇒ Object
9 10 11 12 13 |
# File 'app/controllers/groseillier/administrators_controller.rb', line 9 def show @administrator = Administrator.find(params[:id]) respond_with @administrator end |
#update ⇒ Object
32 33 34 35 36 37 38 39 |
# File 'app/controllers/groseillier/administrators_controller.rb', line 32 def update @administrator = Administrator.find(params[:id]) params[:administrator].delete(:password) if params[:administrator][:password].blank? params[:administrator].delete(:password_confirmation) if params[:administrator][:password_confirmation].blank? @administrator.update_attributes(params[:administrator]) respond_with @administrator end |