Class: Admin::RolesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Admin::RolesController
- Defined in:
- app/controllers/admin/roles_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
23 24 25 26 27 |
# File 'app/controllers/admin/roles_controller.rb', line 23 def create @role = SpudRole.new(params[:spud_role]) flash[:notice] = 'SpudRole created successfully' if @role.save respond_with @role, :location => admin_roles_path end |
#destroy ⇒ Object
41 42 43 44 |
# File 'app/controllers/admin/roles_controller.rb', line 41 def destroy flash[:notice] = 'SpudRole deleted successfully' if @role.destroy respond_with @role, :location => admin_roles_path end |
#edit ⇒ Object
29 30 31 |
# File 'app/controllers/admin/roles_controller.rb', line 29 def edit respond_with @role end |
#index ⇒ Object
9 10 11 12 |
# File 'app/controllers/admin/roles_controller.rb', line 9 def index @roles = SpudRole.all respond_with @roles end |
#new ⇒ Object
18 19 20 21 |
# File 'app/controllers/admin/roles_controller.rb', line 18 def new @role = SpudRole.new respond_with @role end |
#show ⇒ Object
14 15 16 |
# File 'app/controllers/admin/roles_controller.rb', line 14 def show respond_with @role end |
#update ⇒ Object
33 34 35 36 37 38 39 |
# File 'app/controllers/admin/roles_controller.rb', line 33 def update params[:spud_role][:permission_tags] ||= [] if @role.update_attributes(params[:spud_role]) flash[:notice] = 'SpudRole updated successfully' end respond_with @role, :location => admin_roles_path end |