<%= form_for(@user) do |f| %>
  <% if @user.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>

      <ul>
      <% @user.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label :name %><br />
    <%= f.text_field :name %>
  </div>
  <div class="field">
    <%= f.label :password %><br />
    <%= f.text_field :password %>
  </div>
  <div class="field">
    <%= f.label :email %><br />
    <%= f.text_field :email %>
  </div>
  <div class="field">
    <%= f.label :credit %><br />
    <%= f.text_field :credit %>
  </div>
  <div class="field">
    <%= f.label :usergroup %><br />
    <%= f.text_field :usergroup %>
  </div>
  <div class="field">
    <%= f.label :admingroup %><br />
    <%= f.text_field :admingroup %>
  </div>
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>
