Using helper to generate kcal tag
As suggested by Benji
This commit is contained in:
parent
91945b6983
commit
ee86411d58
|
@ -6,15 +6,7 @@
|
|||
</div>
|
||||
<div class="caption">
|
||||
<h6>
|
||||
<% if product.calories %>
|
||||
<%= content_tag :small do
|
||||
concat product.calories
|
||||
concat ' kcal'
|
||||
end
|
||||
%>
|
||||
<% else %>
|
||||
|
||||
<% end %>
|
||||
<%= kcal_tag product.calories %>
|
||||
</h6>
|
||||
<h4 class="text-nowrap">
|
||||
<%= content_tag :span, product.name %>
|
||||
|
|
|
@ -4,13 +4,7 @@
|
|||
<%= image_tag product.avatar %>
|
||||
</div>
|
||||
<div class="caption">
|
||||
<h6>
|
||||
<% if product.calories %>
|
||||
<%= product.calories %> kcal
|
||||
<% else %>
|
||||
|
||||
<% end %>
|
||||
</h6>
|
||||
<%= kcal_tag product.calories %>
|
||||
<h4><%= product.name %></h4>
|
||||
<h3><%= euro(product.price) %></h3>
|
||||
<h6>(In stock: <%= product.stock %>)</h6>
|
||||
|
|
Loading…
Reference in a new issue