We're choosing the default `with_first_argument` style because it's the one we use the most.
12 lines
380 B
Plaintext
12 lines
380 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 %>
|