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, #turbo_frame_request?
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, #root_path_without_url, #svg
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 33 34 35 36 |
# File 'app/controllers/avo/actions_controller.rb', line 13 def handle resource_ids = action_params[:fields][:avo_resource_ids].split(",") @selected_query = action_params[:fields][:avo_selected_query] fields = action_params[:fields].except(:avo_resource_ids, :avo_selected_query) args = { fields: fields, current_user: _current_user, resource: resource } unless @action.standalone args[:models] = if @selected_query.present? @resource.model_class.find_by_sql decrypted_query else @resource.class.find_scope.find resource_ids end end 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 |