Refactored user roles
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
</td>
|
||||
<td class="p-2 py-3 text-nowrap">
|
||||
<span class="inline-flex -space-x-px overflow-hidden rounded-md bg-white shadow divide-x divide-gray-300">
|
||||
<% User::AVAILABLE_ROLES.each do |role| %>
|
||||
<% User.roles.keys.each do |role| %>
|
||||
<% if allowed_to? :change_role?, user %>
|
||||
<% if user.role == role.to_s %>
|
||||
<%= button_to role, admin_user_path(user), method: :patch, params: { user: { role: role }}, form_class: "inline", class: "inline-block px-4 py-2 text-sm uppercase font-medium focus:relative bg-role-#{role}-light text-#{role}" %>
|
||||
|
||||
Reference in New Issue
Block a user