Fix duplicate HTML ID in document fields
Using `dom_id` means generating `new_document` as ID for new documents. Since there might be more than one new document in the form, that means duplicate IDs, which is invalid HTML. Even though this issue doesn't affect image fields (because we don't have many images on the same form), we're removing the ID there as well for consistency.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<div id="<%= dom_id(document) %>" class="document direct-upload document-fields nested-fields">
|
||||
<div class="document direct-upload document-fields nested-fields">
|
||||
<%= f.hidden_field :id %>
|
||||
<%= f.hidden_field :user_id, value: current_user.id %>
|
||||
<%= f.hidden_field :cached_attachment %>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div id="<%= dom_id(image) %>" class="image direct-upload nested-fields">
|
||||
<div class="image direct-upload nested-fields">
|
||||
<%= f.hidden_field :id %>
|
||||
<%= f.hidden_field :user_id, value: current_user.id %>
|
||||
<%= f.hidden_field :cached_attachment %>
|
||||
|
||||
Reference in New Issue
Block a user