Skip to content

Instantly share code, notes, and snippets.

@dabit
Created June 14, 2011 18:04
Show Gist options
  • Save dabit/1025471 to your computer and use it in GitHub Desktop.
Save dabit/1025471 to your computer and use it in GitHub Desktop.
%h2
Brands
.brands
-('A'..'Z').each do |letter|
-li_brands=""
[email protected] do |brand|
-if brand.name.slice(0..0).upcase == letter
-li_brands+="<li>#{link_to(brand.name,{:controller=>:brands, :action => :show, :id =>brand.to_param}, :class=>"#{brand.name}")}</li>"
-unless li_brands==""
.brand
%h3{:class => "letter"}
= letter
%ul{:class => "letter"}
!= li_brands
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment