I have a forum and at the bottom of each page of the current topic I
have a form to add a reply.
I am using the following pagination to display 20 posts per topic per
page = (params[:page] ||= 1).to_i posts_per_page = 20 offset = (page - 1) * posts_per_page @posts = Post.find(:all, :conditions => ["topic_id = ?",
params[:id]], :order => “created_on DESC”)
@post_pages = Paginator.new(self, @posts.length, posts_per_page,
@posts = @posts[offset..(offset + posts_per_page - 1)]
My question is:
When a user adds a reply, I want to then redirect that person to the
last page of posts (which is where their reply will have been added)
Any ideas how i could go about this?