Skip to content

Instantly share code, notes, and snippets.

@diebels727
Created January 13, 2011 16:52
Show Gist options
  • Save diebels727/778165 to your computer and use it in GitHub Desktop.
Save diebels727/778165 to your computer and use it in GitHub Desktop.
audit view
<% for audit in @audits %>
<tr>
<%if audit.user.present? #<--- Guard against nil users.%>
<td><%= link_to(audit.user.to_label, url_for(audit.user)) %></td>
<%else #<--- Present "Missing" on nil user.%>
<td>Missing</td>
<%end%>
<td><%= audit.kind %></td>
<% if audit.auditable.present? %>
<td><%= link_to(audit.auditable.to_label, url_for(audit.auditable) ) %></td>
<% else %>
<td>Missing</td>
<% end %>
<td><%= audit.created_at %></td>
</tr>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment