This way it will be easier to change the behavior of all table actions, like adding ARIA attributes. In the past, when we changed the behavior of the `link_to` method, we had to change all table action classes.
26 lines
1.2 KiB
Plaintext
26 lines
1.2 KiB
Plaintext
<%= render Admin::TableActionsComponent.new(budget,
|
|
destroy_confirmation: t("admin.actions.confirm_delete", resource_name: t("admin.budgets.shared.resource_name"),
|
|
name: budget.name)
|
|
) do |actions| %>
|
|
<%= actions.action(:investments,
|
|
text: t("admin.budgets.index.budget_investments"),
|
|
path: admin_budget_budget_investments_path(budget_id: budget.id)) %>
|
|
<%= actions.action(:groups,
|
|
text: t("admin.budgets.index.edit_groups"),
|
|
path: admin_budget_groups_path(budget)) %>
|
|
<% if budget.poll.present? %>
|
|
<%= actions.action(:ballots,
|
|
text: t("admin.budgets.index.admin_ballots"),
|
|
path: admin_poll_booth_assignments_path(budget.poll)) %>
|
|
<% else %>
|
|
<%= actions.action(:ballots,
|
|
text: t("admin.budgets.index.admin_ballots"),
|
|
path: create_budget_poll_path,
|
|
method: :post) %>
|
|
<% end %>
|
|
<%= actions.action(:preview,
|
|
text: t("admin.budgets.actions.preview"),
|
|
path: budget_path(budget),
|
|
target: "_blank") %>
|
|
<% end %>
|