seouri (owner)

Revisions

gist: 9215 Download_button fork
public
Public Clone URL: git://gist.github.com/9215.git
Embed All Files: show embed
alphabetical_query_list.rb #
1
2
3
4
5
6
7
8
9
def alphabetical_query_list(query)
  li = link_to_unless query.blank?, "All"
  list = [content_tag(:li, li)]
  "A".upto("Z") do |l|
    li = link_to_unless l == query, l, :q => l
    list.push(content_tag(:li, li))
  end
  content_tag :ul, list.join("\n"), :class => "alphabetical"
end