Prevent deleting the last collection

This commit is contained in:
Andy Smith
2025-08-27 14:48:20 -05:00
parent d8a3397c70
commit bb15e5aba1
+6 -4
View File
@@ -1,6 +1,8 @@
<%= form_with model: collection, class: "txt-align-center margin-block-start-auto", method: :delete do |form| %>
<%= form.button class: "btn txt-negative borderless txt-small", data: { turbo_confirm: "Are you sure you want to permanently delete this Collection?" } do %>
<%= icon_tag "trash" %>
<span>Delete this Collection</span>
<% if Current.user.collections.many? %>
<%= form_with model: collection, class: "txt-align-center margin-block-start-auto", method: :delete do |form| %>
<%= form.button class: "btn txt-negative borderless txt-small", data: { turbo_confirm: "Are you sure you want to permanently delete this Collection?" } do %>
<%= icon_tag "trash" %>
<span>Delete this Collection</span>
<% end %>
<% end %>
<% end %>