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

35 lines
960 B
Plaintext
Executable File

<%= form_for(@mac) do |f| %>
<% if @mac.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@mac.errors.count, "error") %> prohibited this MAC from being saved:</h2>
<ul>
<% @mac.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label :user_id, "User" %><br />
<%= collection_select(:mac, :user_id, @users, :id, :name, :include_blank => true) %>
</div>
<div class="field">
<%= f.label :mac %><br />
<%= f.text_field :mac, :value => (@mac.mac || @arp || nil) %>
<% if @arp.present? %><br/><em>Autodetected from your IP of <%= @ip %></em><% end %>
</div>
<div class="field">
<%= f.label :note %><br />
<%= f.text_field :note %>
</div>
<div class="field">
<%= f.label :hidden %><br />
<%= f.check_box :hidden %>
</div>
<div class="actions">
<%= f.submit %>
</div>
<% end %>