add is_admin attribute to users
This commit is contained in:
parent
07877f3256
commit
0418924d8e
7 changed files with 25 additions and 21 deletions
12
app/views/admin/users/_roles.html.haml
Normal file
12
app/views/admin/users/_roles.html.haml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
- if current_user == user
|
||||
You cannot modify your own role!
|
||||
%br
|
||||
%button{:class=> "btn btn-danger", "data-dismiss"=> "modal", "aria-hidden"=>"true"}
|
||||
Cancel
|
||||
- else
|
||||
= "Give #{user.name} (#{user.email}) the following roles:"
|
||||
= semantic_form_for(user, :url => admin_user_path(user), :method => :put) do |f|
|
||||
= f.input :roles, :label => false, collection: @roles
|
||||
%button{:class=> "btn btn-danger", "data-dismiss"=> "modal", "aria-hidden"=>"true"}
|
||||
Cancel
|
||||
= f.action :submit, :as => :button, :button_html => {:value => "Save", :class => "btn btn-primary"}
|
||||
Loading…
Add table
Add a link
Reference in a new issue