Extract component for restore and hide actions

By doing so, we remove a lot of duplication.
This commit is contained in:
Javi Martín
2020-06-14 18:32:21 +02:00
parent 64b0cc741b
commit eb3f2bc2ca
9 changed files with 66 additions and 66 deletions

View File

@@ -0,0 +1,12 @@
<%= render Admin::TableActionsComponent.new(actions: []) do %>
<%= link_to restore_text, restore_path,
method: :put,
data: { confirm: t("admin.actions.confirm") },
class: "button hollow warning" %>
<% unless record.confirmed_hide? %>
<%= link_to confirm_hide_text, confirm_hide_path,
method: :put,
class: "button" %>
<% end %>
<% end %>