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>
|
||||||
<div class="caption">
|
<div class="caption">
|
||||||
<h6>
|
<h6>
|
||||||
<% if product.calories %>
|
<%= kcal_tag product.calories %>
|
||||||
<%= content_tag :small do
|
|
||||||
concat product.calories
|
|
||||||
concat ' kcal'
|
|
||||||
end
|
|
||||||
%>
|
|
||||||
<% else %>
|
|
||||||
|
|
||||||
<% end %>
|
|
||||||
</h6>
|
</h6>
|
||||||
<h4 class="text-nowrap">
|
<h4 class="text-nowrap">
|
||||||
<%= content_tag :span, product.name %>
|
<%= content_tag :span, product.name %>
|
||||||
|
|
|
@ -4,13 +4,7 @@
|
||||||
<%= image_tag product.avatar %>
|
<%= image_tag product.avatar %>
|
||||||
</div>
|
</div>
|
||||||
<div class="caption">
|
<div class="caption">
|
||||||
<h6>
|
<%= kcal_tag product.calories %>
|
||||||
<% if product.calories %>
|
|
||||||
<%= product.calories %> kcal
|
|
||||||
<% else %>
|
|
||||||
|
|
||||||
<% end %>
|
|
||||||
</h6>
|
|
||||||
<h4><%= product.name %></h4>
|
<h4><%= product.name %></h4>
|
||||||
<h3><%= euro(product.price) %></h3>
|
<h3><%= euro(product.price) %></h3>
|
||||||
<h6>(In stock: <%= product.stock %>)</h6>
|
<h6>(In stock: <%= product.stock %>)</h6>
|
||||||
|
|
Loading…
Reference in a new issue