i'm trying to paginate comments with will_paginate in order, newest on
top, and i'm using the sample script from acts_as_commentable in my
commentable_type = params[:commentable][:commentable]
commentable_id = params[:commentable][:commentable_id]
# Get the object that you want to comment
commentable = Comment.find_commentable(commentable_type,
# Create a comment with the user submitted content
comment = Comment.new(params[:comment])
# Assign this comment to the logged in user
comment.user_id = current_user
# Add the comment
commentable.comments << comment
redirect_to :action => "show",
:id => commentable_id
as well as :
@post = Post.paginate :per_page =>10, :page => params[:page],
:order => "DESC"
i have a partial that shows just the comments to the post
<%= will_paginate @post.comments %>
and i get this msg:
undefined method `page_count' for #<Class:0x4a7601c>
so my question is how do i paginate comments for specific posts?
thank you guys!