%# , url: { controller: "rolify", action: "update" }, html: { :turbo_method => :post } %> <%= form_with(model: user, url: rolify_path(user)) do |form| %> <% if user.errors.any? %>
Name: <%= user.name %>
Email: <%= user.email %>
<%= form.label :current_roles, style: "display: block" %> <%= user.roles.where(resource_type: nil).map { |role| role.name.capitalize }.to_sentence %>
<% user.roles.each do |role| %>
<%=
extra_info = if role.resource_type
" (#{role.resource_type}: #{role.resource_id})"
else
""
end
"#{role.id} - #{role.name}, #{extra_info}"
%>
<% end %>