52 lines
1.3 KiB
Plaintext
52 lines
1.3 KiB
Plaintext
|
<%= 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 :email %><br />
|
||
|
<%= f.email_field :email %>
|
||
|
</div>
|
||
|
<% if @user.id.blank? || !params[:password].nil? %>
|
||
|
<div class="field">
|
||
|
<%= f.label :password %><br />
|
||
|
<%= f.password_field :password, :autocomplete => "off" %>
|
||
|
</div>
|
||
|
<div class="field">
|
||
|
<%= f.label :password_confirmation %><br />
|
||
|
<%= f.password_field :password_confirmation %>
|
||
|
</div>
|
||
|
<% else %>
|
||
|
<div class="field">
|
||
|
<a href="?password=edit">Change Password</a>
|
||
|
</div>
|
||
|
<% end %>
|
||
|
<div class="field">
|
||
|
<%= f.label :admin, "Admin?" %><br />
|
||
|
<%= f.check_box :admin %>
|
||
|
</div>
|
||
|
<div class="field">
|
||
|
<h3>Cards</h3>
|
||
|
<ul>
|
||
|
<% @user.cards.each do |c| %>
|
||
|
<li><%= link_to "#{c.card_number} #{c.name}", card_url(c) %></li>
|
||
|
<% end %>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div class="actions">
|
||
|
<%= f.submit %>
|
||
|
</div>
|
||
|
<% end %>
|