Almost done with User edit view. Still need to update styling and change the access start and end date fields.
This commit is contained in:
parent
26a7821e11
commit
bdc5c406c7
|
@ -1,2 +1,6 @@
|
|||
module UsersHelper
|
||||
end
|
||||
def display_user_role(user)
|
||||
user.roles.first&.name&.capitalize || "None"
|
||||
end
|
||||
end
|
||||
|
|
@ -7,16 +7,20 @@
|
|||
<table class="table">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Email</th>
|
||||
<th>Admin</th>
|
||||
<th>Company</th>
|
||||
<th>Permissions</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @users.each do |user| %>
|
||||
<tr>
|
||||
<td><%= user.first_name %> <%= user.last_name %></td>
|
||||
<td><%= user.email %></td>
|
||||
<td><%= user.has_role?(:admin) ? 'Yes' : 'No' %></td> <!-- Assuming you're using Rolify for role management -->
|
||||
<td><%= user.company %></td>
|
||||
<td><%= display_user_role(user) %></td>
|
||||
<td>
|
||||
<%= link_to edit_user_path(user), class: 'btn btn-info btn-sm' do %>
|
||||
<i class="bi bi-pencil-fill" style="color: white;"></i>
|
||||
|
|
Loading…
Reference in New Issue