Class: Avo::ActionsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Avo::ActionsController
- Defined in:
- app/controllers/avo/actions_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
#_current_user, #check_avo_license, #context, #exception_logger, #init_app, #render
Methods included from UrlHelpers
#edit_resource_path, #new_resource_path, #related_resources_path, #resource_attach_path, #resource_detach_path, #resource_path, #resources_path
Methods included from ApplicationHelper
#a_button, #a_link, #button_classes, #empty_state, #get_model_class, #input_classes, #render_license_warning, #render_license_warnings, #svg, #turbo_frame_wrap
Instance Method Details
#handle ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/controllers/avo/actions_controller.rb', line 13 def handle resource_ids = action_params[:fields][:resource_ids].split(",") models = @resource.class.find_scope.find resource_ids fields = action_params[:fields].select do |key, value| key != "resource_ids" end args = { fields: fields, current_user: _current_user, resource: resource, } args[:models] = models unless @action.standalone performed_action = @action.handle_action(**args) respond performed_action.response end |
#show ⇒ Object
9 10 11 |
# File 'app/controllers/avo/actions_controller.rb', line 9 def show @model = ActionModel.new @action.get_attributes_for_action end |