2008-10-22 37 views

回答

3

下面是我在做什么在我的网站的名字我的标签进行排序:

<% 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 %> 
+0

谢谢迈克尔。它像一个魅力。 StackOverflow.com岩石! – allesklar 2008-10-22 21:38:53