app/views/users/_form.html.erb
<%= form_for(@user) do |f| %>
<%= render partial: 'shared/error_messages', locals: { object: @user } %>
<%= f.label :name, class: 'text-left' %>
<%= f.text_field :name %>
<%= f.label :email %>
<%= f.email_field :email %>
<%= f.label :password %>
<%= f.password_field :password %>
<%= f.label :password_confirmation %>
<%= f.password_field :password_confirmation %>
<% if current_user.admin? %>
<fieldset class="fieldset dragons">
<legend>Here there be dragons!</legend>
<%= f.check_box :admin %><%= f.label :admin, 'Make this user an admin?' %>
</fieldset>
<% end %>
<%= f.submit 'Save changes', class: 'button large' %>
<% end %><!-- end `form_for(@user)` -->