Forum: Ruby on Rails Pagination Question [Tagging: find_tagged_with]

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F68e4842b0a5487678e26046fdb2fdf3?d=identicon&s=25 softwareengineer 99 (Guest)
on 2006-03-05 10:02
(Received via mailing list)
Hello experts,

  I am trying to paginate the following query but no matter what I try I
am unable to paginate it.


  In controller I have:

      q_webpages=Webpage.find_tagged_with(:any =>  params[:tag],
:separator=>',', :order=>'updated_at  DESC')
      @webpage_pages, @webpages =
paginate_collection(:collection=>q_webpages)


  In my view I have:

  <%= link_to 'Previous page', { :page =>
@webpage_pages.current.previous } if @webpage_pages.current.previous %>
  <%= link_to 'Next page', { :page => @webpage_pages.current.next } if
@webpage_pages.current.next %>


  The problem is that I do see the Next page link, but when I go to the
next page, it shows the same records as on the first page.

  Can anyone please assist me in this?

  Is there an alternate way to paginate a custom collection such as the
one retrieved using find_tagged_with

  I have spent the entire night trying to resolve this.

  Please help
  Thanks in advance

  Frank


Rails Blog: http://railsruby.blogspot.com
MySQL Blog: http://mysqldatabaseadministration.blogspot.com
Linux / Security Blog: http://frankmash.blogspot.com
This topic is locked and can not be replied to.