title: Tag links not working with acts as taggable on and Rails 3.1
body: <p>I'm currently using the following gems in my application to provide pagination, search, linkable tags, and a tag cloud.</p>
  
  <p>gem 'will_paginate', '~> 3.0.2'
  gem 'acts-as-taggable-on', '~>2.1.0'</p>
  
  <p>I have everything implemented so far in Rails 3.1 except the tag links. I have them displayed below every post and in the tag cloud and both link to different views and neither works.</p>
  
  <p>A link in the tag cloud (Test1) links me to: /posts/tag?id=Test1 which gives me an error "Couldn't find Post with id=tag"</p>
  
  <p>And a link in the post redirects me to /posts?tag=Test2&amp;view=tag which doesn't change anything. All my posts are still displayed.</p>
  
  <p>Here's what I've changed so far to try and implement this:</p>
  
  <p>The edited part of my routes.rb:</p>
  
  <pre><code>resources :posts do
  collection do
    get :tag
  end
  </code></pre>
  
  <p>end</p>
  
  <p>My post.rb:</p>
  
  <pre><code>acts_as_taggable_on :tags
  def self.tag_post_list(page, tag)
  
    Post.tagged_with(tag).by_date.paginate(:page =&gt; params[page], :per_page =&gt; 20)
  
  end
  </code></pre>
  
  <p>Post_Controller.rb:</p>
  
  <pre><code>def index
    @posts = Post.search(params[:search], params[:page])
    @tags = Post.tag_counts_on(:tags)
    if request.xhr?
      render :partial =&gt; @posts
    end
  end
  def tag
    @posts = Post.tagged_with(params[:id])
    @tags = Post.tag_counts_on(:tags)
    render :action =&gt; 'index'
  end
  def show
    @post = Post.find(params[:id])
    @tags = Post.tag_counts_on(:tags)
  
    respond_to do |format|
      format.html # show.html.erb
      format.json { render json: @post }
    end
  end
  </code></pre>
  
  <p>Posts_helper.rb:</p>
  
  <pre><code>include ActsAsTaggableOn::TagsHelper
  </code></pre>
  
  <p>Tag cloud in application.html.erb</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>Tag cloud definition in application_controller.rb</p>
  
  <pre><code>def tag_cloud
    @tags = Post.tag_counts_on(:tags)
  end
  </code></pre>
  
  <p>Links in my posts:</p>
  
  <pre><code>&lt;% for tag in post.tags %&gt;
  &lt;%= link_to tag.name, posts_path(:view =&gt;'tag', :tag =&gt; tag.name) %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>The error in my console:</p>
  
  <pre><code>Started GET "/posts/tag?id=Test1" for 127.0.0.1 at 2011-11-05 00:35:00 -0700
  Processing by PostsController#show as HTML
  Parameters: {"id"=&gt;"tag"}
  Post Load (0.0ms)  SELECT "posts".* FROM "posts" WHERE "posts"."id" = $1 LIMIT 1  [["id", "tag"]]
  Completed 404 Not Found in 3ms
  
  ActiveRecord::RecordNotFound (Couldn't find Post with id=tag): app/controllers/posts_controller.rb:33:in `show'
  </code></pre>
  
  <p>I've searched the internet for the past 5 hours trying to figure this out, but nothing is up to date or entirely relevant.</p>
  
  <p>I get that it is passing "tag" to the show action, but how do I get it to pass the relevant ID and anything else I need to show the correct posts with that tag?</p>