diff --git a/app/helpers/cards_helper.rb b/app/helpers/cards_helper.rb index e13defa96..028a4e715 100644 --- a/app/helpers/cards_helper.rb +++ b/app/helpers/cards_helper.rb @@ -29,4 +29,12 @@ module CardsHelper **options, &block end + + def button_to_delete_card(card) + button_to collection_card_path(card.collection, card), + method: :delete, class: "btn", data: { turbo_confirm: "Are you sure you want to delete this?" } do + concat(icon_tag("trash")) + concat(tag.span("Delete", class: "for-screen-reader")) + end + end end diff --git a/app/views/cards/_container.html.erb b/app/views/cards/_container.html.erb index f6e8101c4..d3a2f1423 100644 --- a/app/views/cards/_container.html.erb +++ b/app/views/cards/_container.html.erb @@ -6,10 +6,7 @@ <%= render "cards/container/gild", card: card if card.doing? %> <%= render "cards/container/image", card: card %> - <%= button_to collection_card_path(card.collection, card), - method: :delete, class: "btn", data: { turbo_confirm: "Are you sure you want to delete this?" } do %> - <%= icon_tag "trash" %> Delete - <% end %> + <%= button_to_delete_card(card) %>