按照 ruby-china 的 commetscell 写,但是运行时出现了这个错误 uninitialized constant CommentsCell::Comment,rails 3.1 and cells 3.8
class CommentsCell < Cell::Rails
def show(opts)
@commentable = opts[:commentable]
@current_user = opts[:current_user]
@comments = Comment.where(:commentable_type => @commentable.class.name, :commentable_id => @commentable.id)
@comment = Comment.new(:commentable_type => @commentable.class.name, :commentable_id => @commentable.id)
render
end
end
目录结构 app/cells/comment_cell.rb app/cells/comments/ app/cells/comments/_comment.html.erb app/cells/comments/show.html.erb