Skip to content

Instantly share code, notes, and snippets.

@zzip
Created April 8, 2009 14:29
Show Gist options
  • Save zzip/91796 to your computer and use it in GitHub Desktop.
Save zzip/91796 to your computer and use it in GitHub Desktop.
<div id="taxonomies" class="sidebar-item">
<% @taxonomies.each do |taxonomy| %>
<h3>Shop by <%= taxonomy.name.singularize %></h3>
<ul class="navigation-list">
<% taxonomies = taxonomy.root.children.find (:all,
:select => "DISTINCT taxons.*",
:joins => :products,
:conditions => ["products.available_on <= ? and products.deleted_at is null", Time.zone.now] )
%>
<% taxonomies.each do |taxon| %>
<% #taxonomy.root.children.each do |taxon| %>
<li<%= ' class="current"' if @taxon and ([@taxon] + @taxon.ancestors).include?(taxon) %>><%= link_to taxon.name, seo_url(taxon) %></li>
<% end %>
</ul>
<% end %>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment