Skip to content

Commit

Permalink
add dropdown to user view page for role
Browse files Browse the repository at this point in the history
  • Loading branch information
lassesteffen committed Dec 16, 2018
1 parent 2612a43 commit 8bf0251
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/views/users/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,16 @@
<% if current_user.admin? %>
<tr>
<td><%= User.human_attribute_name('role') %></td>
<td><%= @user.role %></td>
<td>
<%= form_for @user do |f| %>
<%= f.select :role,
options_from_collection_for_select(User.roles,
'first',
'first'),
class: 'form-control'
%>
<% end %>
</td>
</tr>
<% end %>
<% if @user == current_user %>
Expand Down

0 comments on commit 8bf0251

Please sign in to comment.