Fix duplicate fields in information texts form

We were rendering the same hidden field, with the same HTML ID, one time
per enabled locale.
This commit is contained in:
Javi Martín
2024-10-10 22:06:25 +02:00
parent 55d81fcac7
commit e1353fd865
2 changed files with 1 additions and 1 deletions

View File

@@ -7,6 +7,7 @@
<% contents.each do |group| %>
<% group.each do |content| %>
<b><%= content.key %></b>
<%= hidden_field_tag "contents[content_#{content.key}][id]", content.key %>
<% (content.globalize_locales & enabled_locales.map(&:to_sym)).each do |locale| %>
<%= render Admin::SiteCustomization::InformationTexts::FormFieldComponent.new(content, locale: locale) %>
<% end %>

View File

@@ -1,5 +1,4 @@
<% globalize(locale) do %>
<%= hidden_field_tag "contents[content_#{i18n_content.key}][id]", i18n_content.key %>
<%= text_area_tag "contents[content_#{i18n_content.key}]values[value_#{locale}]",
text,
rows: 5,