Unique IDs for hidden article_archived fields (#9048)

This commit is contained in:
Michael Kohl 2020-07-01 16:35:29 +07:00 committed by GitHub
parent 3833b17a66
commit db17e98804
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -99,7 +99,7 @@
<a href="<%= article.path %>/stats" class="crayons-link crayons-link--block w-100 border-0 bg-transparent">Stats</a>
<% end %>
<%= form_for(article, method: :patch, remote: true, authenticity_token: true, html: { "data-type": "json", class: "js-archive-toggle" }) do |f| %>
<%= f.hidden_field :archived, value: !article.archived %>
<%= f.hidden_field :archived, value: !article.archived, id: "article_archived_#{article.id}" %>
<button type="submit" class="crayons-link crayons-link--block w-100 border-0 bg-transparent">
<%= article.archived ? "Unarchive post" : "Archive post" %>