Using helper to generate kcal tag

As suggested by Benji
This commit is contained in:
David Vandorpe 2015-07-08 17:38:51 +02:00
parent 91945b6983
commit ee86411d58
2 changed files with 2 additions and 16 deletions

View file

@ -6,15 +6,7 @@
</div>
<div class="caption">
<h6>
<% if product.calories %>
<%= content_tag :small do
concat product.calories
concat ' kcal'
end
%>
<% else %>
&nbsp;
<% end %>
<%= kcal_tag product.calories %>
</h6>
<h4 class="text-nowrap">
<%= content_tag :span, product.name %>

View file

@ -4,13 +4,7 @@
<%= image_tag product.avatar %>
</div>
<div class="caption">
<h6>
<% if product.calories %>
<%= product.calories %> kcal
<% else %>
&nbsp;
<% end %>
</h6>
<%= kcal_tag product.calories %>
<h4><%= product.name %></h4>
<h3><%= euro(product.price) %></h3>
<h6>(In stock: <%= product.stock %>)</h6>