[Rails] Pagination Question [Tagging: find_tagged_with]

softwareengineer 99 softwareengineer99 at yahoo.com
Sun Mar 5 09:01:37 GMT 2006


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
		
---------------------------------
Relax. Yahoo! Mail virus scanning helps detect nasty viruses!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060305/b585f57e/attachment.html


More information about the Rails mailing list