Replace 'remove this redaction' confirmation and request with Turbo

This commit is contained in:
Anton Khorev 2024-09-11 17:43:37 +03:00
parent a0c9504e22
commit 138988860c
2 changed files with 34 additions and 1 deletions

View file

@ -18,7 +18,7 @@
<%= link_to t(".edit"), edit_redaction_path(@redaction), :class => "btn btn-outline-primary" %>
<% end %>
<% if can?(:destroy, Redaction) %>
<%= link_to t(".destroy"), @redaction, :method => "delete", :class => "btn btn-outline-danger", :remote => true, :data => { :confirm => t(".confirm") } %>
<%= link_to t(".destroy"), @redaction, :class => "btn btn-outline-danger", :data => { :turbo => true, :turbo_method => "DELETE", :turbo_confirm => t(".confirm") } %>
<% end %>
</div>
<% end %>