Class: Role::ActionsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Role::ActionsController
- Defined in:
- app/controllers/lesli_shield/role/actions_controller.rb
Instance Method Summary collapse
Instance Method Details
#destroy ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'app/controllers/lesli_shield/role/actions_controller.rb', line 26 def destroy if @role_action.result.delete @role_actions = RoleActionService.new(current_user, query).index(@role.id) respond_with_lesli( :turbo => [ stream_notification_warning("Role privileges removed successfully!"), turbo_stream.replace('shield-role-actions-form', partial: 'lesli_shield/role/actions/form') ] ) else respond_with_lesli( :turbo => stream_notification_danger(@role_action.errors_as_sentence) ) end end |
#index ⇒ Object
6 7 8 |
# File 'app/controllers/lesli_shield/role/actions_controller.rb', line 6 def index @role_actions = RoleActionService.new(current_user, query).index(@role.id) end |
#update ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/lesli_shield/role/actions_controller.rb', line 10 def update if @role_action.result.recover @role_actions = RoleActionService.new(current_user, query).index(@role.id) respond_with_lesli( :turbo => [ stream_notification_success("Role privileges added successfully!"), turbo_stream.replace('shield-role-actions-form', partial: 'lesli_shield/role/actions/form') ] ) else respond_with_lesli( :turbo => stream_notification_danger(@role_action.errors_as_sentence) ) end end |