if you need an ajax friendly paginator, I’d suggest using the will_paginate plugin (
http://errtheblog.com/post/4791) and then apply the following patch:
http://pastie.caboo.se/80535
you can then paginate your collection of objects as follows:
<%= will_paginate @products, :ajax_method => ‘my_ajax_callback’ %>
and of course you’d replace @products and ‘my_ajax_callback’ with the name of your objects and ajax pagination method.
Adam
copy the contents of the patch into a new textfile, call it something
like "view_helpers_ajax.patch" and place it in the same directory as
your view_helpers.rb file (it'll be in
#{RAILS_ROOT}/vendor/plugins/will_paginate/lib/). Then just enter the
following at the command line:
patch -p0 <view_helpers_ajax.patch
You should see the following output:
Hmm... Looks like a unified diff to me...
The text leading up to this was:
Here's my modified view_helpers.rb file. Just copy and paste it from here:
http://pastie.caboo.se/80752
Adam