Rails 3标记问题,acts_as_taggable_on

我正在使用acts_as_taggable_on为post添加标签,其他标签插件/gem不能与rails 3一起使用。我可以在post模型上编辑/显示标签,标签控制器显示按名称标记的post,即/ tags / post-标签名称/。 我想要的function是将post页面上的标签转换为链接,以显示具有相同标签的其他post。 我按照sitepoints’简单的rails 2’中的教程使用了acts_as_taggable_on_steroids,但我遇到了以下错误;

ActionView::MissingTemplate in Posts#show Missing partial acts_as_taggable_on/tags/tag with {:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml], :formats=>[:html], :locale=>[:en, :en]} in view paths "../app/views" Extracted source (around line #28): 25: 
26: 27:

28: @post.tags %>

29:

 class Post < ActiveRecord::Base ... acts_as_taggable_on :tags end class TagsController < ApplicationController def show @post = Post.tagged_with(params[:id]) end end 

_tag.html.erb

  tag.name) %> 

文章/ show.html.erb

 

@post.tags %>

还试图在tags / index.html上添加标签云,如http://github.com/mbleigh/acts-as-taggable-on给出的路由错误;

 No route matches {:action=>"tag", :id=>"news", :controller=>"tags"} 

看起来你想要使用:collection,它将使用模板呈现整个列表:

 
<% unless @post.tag_list.empty? %>

<%= render :partial => 'tag', :collection => @post.tags %>

<% end %>
Interesting Posts