views:

482

answers:

1

I got the acts_as_taggable_on_steroids plugin to work fine. The tag_cloud method in my view create and formats the cloud properly however the tags are listed in order of 'count desc'.

How to I present my tags in the cloud in alphabetical order?

+1  A: 

Here is what I am doing on my site to sort my tags by name:

<% tag_cloud Post.tag_counts.sort { |x, y| x.name <=> y.name }, %w(x-small small normal large x-large) do |tag, css_class| %>
  <%= link_to tag.name, tag_url( :tag => tag.name ), :class => css_class %>
<% end %>
Michael Sepcot
Thank you Michael. It worked like a charm. StackOverflow.com rocks!
allesklar
I'd use sort_by
reto