diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 2310a24..83a7951 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -1,2 +1,6 @@ module UsersHelper -end + def display_user_role(user) + user.roles.first&.name&.capitalize || "None" + end + end + \ No newline at end of file diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 6ec33d9..1ca70bd 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -7,16 +7,20 @@
Name | Admin | +Company | +Permissions | Actions | |
---|---|---|---|---|---|
<%= user.first_name %> <%= user.last_name %> | <%= user.email %> | -<%= user.has_role?(:admin) ? 'Yes' : 'No' %> | +<%= user.company %> | +<%= display_user_role(user) %> | <%= link_to edit_user_path(user), class: 'btn btn-info btn-sm' do %> |