Open-Source-Access-Control-.../app/views/cards/_form.html.erb
2014-02-09 00:56:48 -07:00

39 lines
1.1 KiB
Plaintext
Executable File

<%= form_for(@card) do |f| %>
<% if @card.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@card.errors.count, "error") %> prohibited this card from being saved:</h2>
<ul>
<% @card.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<% @card.user_id = params[:user] if params[:user].present? %>
<div class="field">
<%= f.label :user %><br />
<%= collection_select(:card, :user_id, User.all.sort_by(&:name), :id, :name, :include_blank => true) %>
</div>
<div class="field">
<%= f.label :name, "Card Note" %><br />
<%= f.text_field :name %>
</div>
<div class="field">
<%= f.label :id, "Card DB ID" %><br />
<%= f.number_field :id, :in => 10...201 %>
</div>
<div class="field">
<%= f.label :card_number, "Card Number" %><br />
<%= f.text_field :card_number %>
</div>
<div class="field">
<%= f.label :card_permissions %><br />
<%= f.select :card_permissions, [["Enabled",1],["Disabled",255]] %>
</div>
<div class="actions">
<%= f.submit %>
</div>
<% end %>