%= form_for(@user) do |f| %>
<% if @user.errors.any? %>
<%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:
<% @user.errors.full_messages.each do |msg| %>
- <%= msg %>
<% end %>
<% end %>
<%= f.label :name %>
<%= f.text_field :name %>
<%= f.label :email %>
<%= f.email_field :email %>
<% if @user.id.blank? || !params[:password].nil? %>
<%= f.label :password %>
<%= f.password_field :password, :autocomplete => "off" %>
<%= f.label :password_confirmation %>
<%= f.password_field :password_confirmation %>
<% else %>
<% end %>
<%= f.label :admin, "Admin?" %>
<%= f.check_box :admin %>
Cards
<% @user.cards.each do |c| %>
- <%= link_to "#{c.card_number} #{c.name}", card_url(c) %>
<% end %>
<%= f.submit %>
<% end %>