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.
11 lines
375 B
Plaintext
11 lines
375 B
Plaintext
<% if already_has_role? %>
|
|
<%= render Admin::TableActionsComponent.new(record,
|
|
actions: actions,
|
|
destroy_options: { class: "destroy-role-link" }
|
|
) %>
|
|
<% else %>
|
|
<%= render Admin::TableActionsComponent.new(record, actions: []) do |actions| %>
|
|
<%= actions.action(:create_role, text: add_user_text, path: add_user_path, method: :post) %>
|
|
<% end %>
|
|
<% end %>
|