diff --git a/app/controllers/avo/actions_controller.rb b/app/controllers/avo/actions_controller.rb index d01acf2ded..89e0efe394 100644 --- a/app/controllers/avo/actions_controller.rb +++ b/app/controllers/avo/actions_controller.rb @@ -4,7 +4,7 @@ module Avo class ActionsController < ApplicationController before_action :set_resource_name before_action :set_resource - before_action :set_record, only: [:show, :handle], if: ->(request) do + before_action :set_record, only: :show, if: ->(request) do # Try to se the record only if the user is on the record page. # set_record will fail if it's tried to be used from the Index page. request.params[:id].present? diff --git a/app/views/avo/actions/show.html.erb b/app/views/avo/actions/show.html.erb index ad4834aa5b..a91e12147b 100644 --- a/app/views/avo/actions/show.html.erb +++ b/app/views/avo/actions/show.html.erb @@ -11,7 +11,7 @@ class="hidden text-slate-800" > <%= form_with scope: 'fields', - url: @action.link_arguments(resource: @resource).first, + url: Avo::Services::URIService.parse(@resource.records_path).append_paths("actions").to_s, local: true, html: { novalidate: true, @@ -29,6 +29,7 @@
<%= @action.get_message %>
+ <%= hidden_field_tag :action_id, @action.to_param %> <%= form.hidden_field :avo_resource_ids, value: params[:id] || params[:resource_ids], 'data-action-target': 'resourceIds' %> <%= form.hidden_field :avo_selected_query, 'data-action-target': 'selectedAllQuery' %> <%= form.hidden_field :arguments, value: params[:arguments] %> diff --git a/lib/avo/base_action.rb b/lib/avo/base_action.rb index 7a00ae05ab..5e69d789e4 100644 --- a/lib/avo/base_action.rb +++ b/lib/avo/base_action.rb @@ -33,7 +33,6 @@ def current_user delegate :avo, to: :view_context delegate :main_app, to: :view_context delegate :to_param, to: :class - delegate :link_arguments, to: :class class << self delegate :context, to: ::Avo::Current