title: Rails: Helper function not found in view
body: <p>I'm following the instructions at: <a href="http://agilewebdevelopment.com/plugins/acts_as_taggable_on_steroids" rel="nofollow noreferrer">http://agilewebdevelopment.com/plugins/acts_as_taggable_on_steroids</a> to add the tag cloud to my view:</p>
  
  <p>in the controller:</p>
  
  <pre><code>class PostController &lt; ApplicationController
     def tag_cloud
        @tags = Post.tag_counts
     end
  end
  </code></pre>
  
  <p>I also added the <code>tag_cloud</code> method as a helper method in the controller</p>
  
  <p>and in the view:</p>
  
  <pre><code>&lt;% tag_cloud @tags, %w(css1 css2 css3 css4) do |tag, css_class| %&gt;                   (line 1)
    &lt;%= link_to tag.name, { :action =&gt; :tag, :id =&gt; tag.name }, :class =&gt; css_class %&gt; (line2)
  &lt;% end %&gt; (line 3)
  </code></pre>
  
  <p>However:</p>
  
  <p>1) if I don't add the <code>helper_method :tag_cloud</code> in the controller I get a <code>undefined method</code> error for <code>tag_cloud</code></p>
  
  <p>2) if I do add the helper method I get: <code>wrong number of arguments (2 for 0)</code> on the same line 1 of my sample code above.</p>
  
  <p>Suggestions?</p>
  
  <p><strong>SOLUTION</strong>
  I ended up not doing what I had as example code in the view. </p>
  
  <p>Instead I did this:</p>
  
  <pre><code>&lt;% @post.tags.each do |tag| %&gt;
      &lt;%= link_to( tag.name,tag,:class =&gt; "tag_cloud_item_link") %&gt;
  &lt;% end %&gt;
  </code></pre>