tap/app/views/products/_product.html.erb

15 lines
536 B
Text
Raw Normal View History

2014-12-09 14:39:27 +01:00
<div class="col-md-3">
<div class="thumbnail">
<%= image_tag product.avatar %>
<div class="caption">
2015-02-08 10:11:23 +01:00
<h3><%= product.name %> - <%= euro(product.price) %> (<%= product.stock %>)</h3>
2015-02-10 07:15:25 +01:00
<% 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 %>
2014-12-09 14:39:27 +01:00
</div>
</div>
</div>