Fix #4535: Comment edit forms contain duplicate IDs.
Prefix comment form IDs with `post_<id>_comment_<id>` to ensure uniqueness.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<%= error_messages_for :comment %>
|
||||
|
||||
<%= edit_form_for(comment, html: { style: ("display: none;" if local_assigns[:hidden]), class: "edit_comment" }) do |f| %>
|
||||
<%= edit_form_for(comment, namespace: "post_#{comment.post.id}_comment_#{comment.id || "new"}", html: { style: ("display: none;" if local_assigns[:hidden]), class: "edit_comment" }) do |f| %>
|
||||
<% if comment.new_record? %>
|
||||
<%= f.hidden_field :post_id %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user