Skip to content

Commit

Permalink
fix: broken attach and attach another button for searchable associati…
Browse files Browse the repository at this point in the history
…ons (#3457)

* fix: broken attach and attach another button for searchable associations

* Move the hidden_field_tag instead of placing in the URL params
  • Loading branch information
ObiWanKeoni authored Nov 27, 2024
1 parent c60e854 commit 35d1788
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/views/avo/associations/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,14 @@
stacked: true,
classes: 'w-full'
%>
<%= hidden_field_tag :turbo_frame, params[:turbo_frame] %>
<% end %>
<%#
It is important to render this hidden field to allow selective rendering of the turbo frame.
(e.g. in the case of "Attach and Attach Another")
Without this, the entire page will be reloaded when the form is submitted.
%>
<%= hidden_field_tag :turbo_frame, params[:turbo_frame] %>
<% @attach_fields&.each_with_index do |field, index| %>
<%= render(Avo::Items::SwitcherComponent.new(
resource: @related_resource,
Expand Down

0 comments on commit 35d1788

Please sign in to comment.