Skip to content

Commit

Permalink
Revert "feature: hydrate record when fetchinf fields on actions' …
Browse files Browse the repository at this point in the history
…`handle`"

This reverts commit d2d5fce.
  • Loading branch information
Paul-Bob committed Aug 5, 2024
1 parent d2d5fce commit 9d5864f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/avo/actions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
3 changes: 2 additions & 1 deletion app/views/avo/actions/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -29,6 +29,7 @@
<div class="flex-1 flex">
<%= @action.get_message %>
</div>
<%= 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] %>
Expand Down
1 change: 0 additions & 1 deletion lib/avo/base_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9d5864f

Please sign in to comment.