Forum: Ruby on Rails Pagination and AJAX

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.
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 => @image_pages.current.next } if
@image_pages.current.next %>

to get users to the next page.

The tutorial at: http://wiki.rubyonrails.com/rails/pages/How+to
+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('http://images.bluechips.com/DomainWorks/
Submits/add.gif',
           :size => '37x16', :alt => 'ADD', :border => '0'),
         :url => url_for(:controller => 'image', :action => :list),
         :update => :images_list,
       { :page => @image_pages.current.previous } if
@image_pages.current.next %>

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.

--ejw

Eric Woodward
Email: ejw@statewood.com
This topic is locked and can not be replied to.