Updating how macs are stored/viewed
This commit is contained in:
parent
1b64a6b931
commit
d156edd683
|
@ -97,7 +97,8 @@ end
|
||||||
def update
|
def update
|
||||||
#Log who updated this
|
#Log who updated this
|
||||||
@mac = Mac.find(params[:id])
|
@mac = Mac.find(params[:id])
|
||||||
@mac.user_id = params[:mac][:user_id]
|
@mac.assign_attributes(params[:mac])
|
||||||
|
#@mac.user_id = params[:mac][:user_id]
|
||||||
authorize! :update, @mac
|
authorize! :update, @mac
|
||||||
|
|
||||||
if can? :manage, Mac then
|
if can? :manage, Mac then
|
||||||
|
|
|
@ -8,6 +8,7 @@ Rails.logger.info mac.inspect %>
|
||||||
<li>
|
<li>
|
||||||
<span title="<%= mac.mac if user_signed_in? %><%= " - "+mac.ip.to_s if can? :read_details, mac %><%= " - "+((Time.now - mac.since) / 1.hour).round(1).to_s+" hours" if can? :manage, mac %>">
|
<span title="<%= mac.mac if user_signed_in? %><%= " - "+mac.ip.to_s if can? :read_details, mac %><%= " - "+((Time.now - mac.since) / 1.hour).round(1).to_s+" hours" if can? :manage, mac %>">
|
||||||
<%= mac.user.name unless mac.user.blank? %>
|
<%= mac.user.name unless mac.user.blank? %>
|
||||||
|
<%= mac.mac if mac.user.blank? %>
|
||||||
<%= "("+mac.note+")" unless mac.note.blank? %></span>
|
<%= "("+mac.note+")" unless mac.note.blank? %></span>
|
||||||
<%= link_to ' Edit', edit_mac_path(mac) if can? :update, mac %> <br/>
|
<%= link_to ' Edit', edit_mac_path(mac) if can? :update, mac %> <br/>
|
||||||
</li>
|
</li>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user