I have a list of elements, and I’ve been using will_paginate up until now, but I’d like to have something like “load more…” at the bottom of the list. Is there an easy way to accomplish this using will_paginate or do I need to resort to some other method here?
From what I know this is a better route anyhow because then I don’t need a SQL count of the records. And it really doesn’t matter if there are like 9,847 pages, nobody would need the records beyond the first couple pages anyhow.
Take a look how Twitter or Brightkite implement their “Load More” buttons (for the javascript side of things). You’ll still want to have some sort of pagination mechanism in your rails app. It probably doesn’t need to be as complex as will_paginate. Maybe something like this in your controller:
Then in your AJAX call to get more records you’ll need to pass back the proper “page” number and be sure to increment it every time the load more button is pressed.