Use a button to destroy pages from the edit page
We were already using buttons to destroy pages from the pages index. As mentioned in commits5311daadfandbb958daf0, using links combined with JavaScript to generate POST (or, in this case, DELETE) requests to the server has a few issues.
This commit is contained in:
@@ -2,7 +2,13 @@
|
||||
<%= back_link_to admin_site_customization_pages_path %>
|
||||
|
||||
<%= header do %>
|
||||
<%= link_to t("admin.site_customization.pages.index.delete"), admin_site_customization_page_path(page), method: :delete, class: "delete" %>
|
||||
<%= render Admin::ActionComponent.new(
|
||||
:destroy,
|
||||
@page,
|
||||
text: t("admin.site_customization.pages.index.delete"),
|
||||
method: :delete,
|
||||
class: "delete"
|
||||
) %>
|
||||
<% end %>
|
||||
|
||||
<%= render "form" %>
|
||||
|
||||
Reference in New Issue
Block a user