Extract helper method to keep partial at a uniform level of abstraction
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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" %> <span class="for-screen-reader">Delete</span>
|
||||
<% end %>
|
||||
<%= button_to_delete_card(card) %>
|
||||
</aside>
|
||||
|
||||
<div class="card-perma__bg">
|
||||
|
||||
Reference in New Issue
Block a user