Skip to content

Instantly share code, notes, and snippets.

@olistik
Created February 9, 2012 14:51
Show Gist options
  • Save olistik/1780463 to your computer and use it in GitHub Desktop.
Save olistik/1780463 to your computer and use it in GitHub Desktop.
<div id="bags">
<ul>
<% last_store_name = nil %>
<% bags.each_with_index do |bag, index| %>
<%
extra_class = if last_store_name != bag.store.name
last_store = bag.store
"first_of_serie #{bag.store.name}"
else
''
end
%>
<li data-index="<%= index %>" class="<%= extra_class %>" data-detail-path="<%= bag.detail_path %>">
<%= image_tag bag.thumbnail_path %>
</li>
<% end %>
</ul>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment