title: Limiting the Amount of Tags for Acts as Taggable On
body: <p>I am wondering how to limit the amount of tags, the tag_cloud function returns for this plugin. <a href="http://github.com/collectiveidea/acts-as-taggable-on" rel="nofollow noreferrer">http://github.com/collectiveidea/acts-as-taggable-on</a></p>
  
  <p>Also, I would like to know how to order it so that it orders the tags by the highest count. So the most popular are at the top.</p>
  
  <p>I tried to do @tags = Post.tag_counts_on(:tags, :limit => 5) but that did not work.</p>
  
  <p>Controller:</p>
  
  <pre><code>class PostController &lt; ApplicationController
    def tag_cloud
       @tags = Post.tag_counts_on(:tags)
    end
  end
  </code></pre>
  
  <p>View:</p>
  
  <pre><code> &lt;% tag_cloud @tags, %w(css1 css2 css3 css4) do |tag, css_class| %&gt;
      &lt;%= link_to tag.name, { :action =&gt; :tag, :id =&gt; tag.name }, :class =&gt; css_class %&gt;
   &lt;% end %&gt;
  </code></pre>
  
  <p>Thanks!</p>