Forum: Ruby on Rails Pagination and AJAX

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
4afd33d6e06fdf951d479a6699322cda?d=identicon&s=25 Eric Woodward (Guest)
on 2006-01-29 08:12
(Received via mailing list)
How does one do pagination with link_to_remote calls so the
pagination can be done with AJAX? For example, this obviously works
out of the box with the standard scaffold:

<%= link_to 'Next page', { :page => } if %>

to get users to the next page.

The tutorial at:
+Paginate+With+Ajax is helpful. The last solution at the bottom of
the page seems the best, but where would an image reference go? How
would I get to something like this:

<%= link_to_remote image_tag('
           :size => '37x16', :alt => 'ADD', :border => '0'),
         :url => url_for(:controller => 'image', :action => :list),
         :update => :images_list,
       { :page => @image_pages.current.previous } if %>

Is something like this really not possible? Please help if you have
solved this already. The solutions on that tutorial are not great.
And of course, I cannot find documentation for the :page option of
link_to anywhere.


Eric Woodward
This topic is locked and can not be replied to.