Rails 3 - “More” ajax pagination with Kaminari?

Usage: # link_to_next_page(@items) # link_to_next_page(@items, :remote => true) # Ajax def link_to_next_page(scope, name, options = {}, &block) param_name = options. Delete(:param_name) || Kaminari.config. Param_name link_to_unless scope.

Last_page? , name, {param_name => (scope. Current_page + 1)}, options.

Merge(:rel => 'next') do block. Call if block end end I'm ready to include this kind of helper methods to the gem if you find it useful, so please let me know what you think. Thanks!

Great, works great! Indeed it would be useful to have that included in the gem. It would cover a very attractive and more and more common kind of pagination :) Thanks!

– invaino May 5 at 7:56 I came across this as I'm trying to create a "more" button myself. I'm really new with jquery and can't seem to get anything going. Could you explain how this helper method could be hooked up with jquery to make the "more" button?

– trying_hal9000 May 21 at 4:49 The more button is great but let the previous items remain and the next items should be below the previous items.. I would be better – Uchenna Okafor Jul 24 at 22:45 Thank for this part of code, it helped. But I would like to ask you - I have problem, because I tried to use this helper by you, but if I will use link_to_next_page(@items, :remote => true) or link_to_next_page(@items, :remote => false), so it's the same, after click on the link I will get to URL page parameter. What I am doing bad?

– user705586 Jul 29 at 7:52.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions