tap/app/views/products/_product.html.erb
2015-02-12 16:14:11 +01:00

16 lines
578 B
Text

<div class="col-md-3">
<div class="thumbnail pic">
<%= image_tag product.avatar %>
<div class="caption">
<h4><%= product.name %></h4>
<h3><%= euro(product.price) %></h3>
<h6>(In stock: <%= product.stock %>)</h6>
<% if current_user && current_user.admin? %>
<p>
<%= link_to "Edit", edit_product_path(product), class: "btn btn-default" %>
<%= link_to "Delete", product_path(product), method: :delete, class: "btn btn-danger", data: {confirm: 'Are you sure?'} %>
</p>
<% end %>
</div>
</div>
</div>