Skip to content

Instantly share code, notes, and snippets.

@henryhamon
Last active December 16, 2015 04:49
Show Gist options
  • Save henryhamon/5380381 to your computer and use it in GitHub Desktop.
Save henryhamon/5380381 to your computer and use it in GitHub Desktop.
<% @featured_products_groups.each do |featured_products_group| %>
<h5><%= featured_products_group.title.upcase %></h5>
<div class="show-case">
<% featured_products_group.featured_products.each_with_index do |featured_product, index| %>
<% product = featured_product.product %>
<% unless product.blank? %>
<div class="<%= index + 1 %>" data-color="<%= featured_products_group.color %>">
<%= link_to household_linen_product_path(product) do %>
<% if product.product_images.empty? %>
<%= image_tag "minor_imagem_indisponivel.jpg" %>
<% else %>
<%= image_tag product.product_images.order(:position).first.image_url(:minor).to_s %>
<% end %>
<% end %>
<span class="legend"><%= product.abbreviated_name.present? ? product.abbreviated_name : product.name.slice(0..31) %></span>
<div class="home-bottom-detail"></div>
</div>
<% end %>
<% end %>
</div>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment