Endless Pages
Having heard a blurb on an endless page plugin on the RailsEnvy podcast, I decided to check it out. I wasn’t happy with how the plugin worked, so I whipped up something similar.
(Original post mentioned on RailsEnvy: link)
I decided most of what was needed was a mix of the wonderful will_paginate plugin and some Javascript. Thus endlesspage.js was born.
After including endlesspage.js in your layout, you should be able to do follow along below on how to set it up.
In the Controller: pastie
In the Views: pastie
Here is the file: endlesspage.js
(Sorry, but I couldn’t get Tumblr to cooperate with dumping in code.)
Let me know if you find this helpful…
UPDATE: I was informed (and confirmed myself) that the gem version of will_paginate doesn’t have the page_count method. The substitute method is total_pages.