Got macs working

This commit is contained in:
2013-01-31 22:39:33 -07:00
parent 998558cd30
commit 04764af983
7 changed files with 60 additions and 6 deletions

View File

@@ -13,12 +13,20 @@
<div class="field">
<%= f.label :user_id, "User" %><br />
<%= collection_select(:mac, :user_id, @users, :id, :name) %>
<%= collection_select(:mac, :user_id, @users, :id, :name, :include_blank => true) %>
</div>
<div class="field">
<%= f.label :mac, "Mac" %><br />
<%= f.label :mac %><br />
<%= f.text_field :mac %>
</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>

View File

@@ -1,5 +1,5 @@
<h2>What machines are on our network?</h2>
<% @macs.each do |mac| %>
<% @active_macs.each do |mac| %>
<%= mac.user.name unless mac.user.blank? %>
<%= mac.mac if mac.user.blank? %> <!--
<%= mac.since %>,
@@ -7,3 +7,23 @@
<%= mac.active %>--> |
<%= link_to 'Edit', edit_mac_path(mac) %> <br/>
<% end %>
<hr>
<% @hidden_macs.each do |mac| %>
<%= mac.user.name unless mac.user.blank? %>
<%= mac.mac if mac.user.blank? %>
(<%= mac.note %>) <!--
<%= mac.since %>,
<%= mac.refreshed %>,
<%= mac.active %>--> |
<%= link_to 'Edit', edit_mac_path(mac) %> <br/>
<% end %>
<hr>
<% @inactive_macs.each do |mac| %>
<%= mac.user.name unless mac.user.blank? %>
<%= mac.mac if mac.user.blank? %>
(<%= mac.note %>) <!--
<%= mac.since %>,
<%= mac.refreshed %>,
<%= mac.active %>--> |
<%= link_to 'Edit', edit_mac_path(mac) %> <br/>
<% end %>

View File

@@ -8,5 +8,20 @@
<%= @mac.mac %>
</p>
<p>
<b>Note:</b>
<%= @mac.note %>
</p>
<p>
<b>Hidden:</b>
<%= @mac.hidden %>
</p>
<p>
<b>IP:</b>
<%= @mac.ip %>
</p>
<%= link_to 'Edit', edit_mac_path(@mac) %> |
<%= link_to 'Back', macs_path %>