Skip to content

Instantly share code, notes, and snippets.

@mikecmpbll
Last active January 3, 2016 08:49
Show Gist options
  • Save mikecmpbll/8438692 to your computer and use it in GitHub Desktop.
Save mikecmpbll/8438692 to your computer and use it in GitHub Desktop.
<body id="brands" data-hook="body">
<ul class="letters">
<% ('A'..'Z').each do |letter| %>
<li><%= link_to letter, "#", class: "key-link", data: { letter: letter } %></li>
<% end %>
</ul>
<hr>
<% @brands.each do |key, brands| %>
<ul class="brand-letters">
<li id="letter-<%= key %>" class="key"><%= key %></li>
<% brands.each do |taxon| %>
<li class="name"><%= link_to taxon.name, seo_url(taxon) %></li>
<% end %>
</ul>
<% end %>
</body>
# ...
@brands = Spree::Taxonomy.where(:name => 'Brands').first.taxons.order(:name).group_by { |b| b.name[0] } %>
# ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment