Extract component for restore and hide actions
By doing so, we remove a lot of duplication.
This commit is contained in:
12
app/components/admin/hidden_table_actions_component.html.erb
Normal file
12
app/components/admin/hidden_table_actions_component.html.erb
Normal 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 %>
|
||||
Reference in New Issue
Block a user