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 28 29 |
# File 'app/controllers/admin/roles_controller.rb', line 23 def create logger.debug 'role_params:' logger.debug role_params @role = SpudRole.new(role_params) flash[:notice] = 'SpudRole created successfully' if @role.save respond_with @role, :location => admin_roles_path end |
#destroy ⇒ Object
43 44 45 46 |
# File 'app/controllers/admin/roles_controller.rb', line 43 def destroy flash[:notice] = 'SpudRole deleted successfully' if @role.destroy respond_with @role, :location => admin_roles_path end |
#edit ⇒ Object
31 32 33 |
# File 'app/controllers/admin/roles_controller.rb', line 31 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.includes(:spud_role_permissions) 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
35 36 37 38 39 40 41 |
# File 'app/controllers/admin/roles_controller.rb', line 35 def update #role_params[:permission_tags] ||= [] if @role.update_attributes(role_params) flash[:notice] = 'SpudRole updated successfully' end respond_with @role, :location => admin_roles_path end |