Allowing people to view/edit

This commit is contained in:
2014-02-09 05:13:35 -07:00
parent 2c4cd4a020
commit ee7e79a433
7 changed files with 20 additions and 11 deletions

View File

@@ -1,12 +1,12 @@
<div class="col-sm-2">
<div class="thumbnail">
<% if resource.user %>
<span class="ownership">Owned by:<br/><%= resource.user.name %></span>
<% end %>
<% if resource.disposed_at %>
<span class="disposed">Disposed:<br/><%= resource.disposed_at.to_date %></span>
<% end %>
<%= link_to(resource) do %>
<% if resource.user %>
<span class="ownership">Owned by:<br/><%= resource.user.name %></span>
<% end %>
<% if resource.disposed_at %>
<span class="disposed">Disposed:<br/><%= resource.disposed_at.to_date %></span>
<% end %>
<%= image_tag(resource.picture.url(:thumb)) if resource.picture? %>
<h4><%=h resource.name %></h4>
<% end %>

View File

@@ -2,7 +2,7 @@
<h2><%=h @resource.name %>
<%= link_to 'Back', resources_path, class: "btn btn-default" %>
<%= link_to 'Edit', edit_resource_path(@resource), class: "btn btn-primary" %>
<%= link_to 'Edit', edit_resource_path(@resource), class: "btn btn-primary" if can? :edit, @resource %>
</h2>
<% if @resource.user || @resource.owner %>
<p>