Skip to content

Commit b417f28

Browse files
committed
Fix hidden_field_tag params for Rails 7 upgrade
This change addresses a breaking issue introduced by the Rails 7 upgrade, where the hidden_field_tag parameters for nested attributes were not being processed correctly. The parameter structure has been updated to match Rails 7's expected format, ensuring proper handling of nested associations.
1 parent 434074a commit b417f28

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

app/views/research_outputs/metadata_standards/_search_result.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<%# locals: result %>
22

33
<% if result.present? %>
4-
<%= hidden_field_tag "research_output[metadata_standards_attributes[#{result.id}][id]]", result.id %>
4+
<%= hidden_field_tag "research_output[metadata_standards_attributes][#{result.id}][id]", result.id %>
55

66
<p><%= sanitize(result.description) %></p>
77

app/views/research_outputs/repositories/_search_result.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
%>
44

55
<% if result.present? %>
6-
<%= hidden_field_tag "research_output[repositories_attributes[#{result.id}][id]]", result.id %>
6+
<%= hidden_field_tag "research_output[repositories_attributes][#{result.id}][id]", result.id %>
77

88
<p><%= result.description %></p>
99

0 commit comments

Comments
 (0)