Is there a rails plugin that will do alphabetical pagination/navigation?
I have a very large data set and would prefer something that gave users a more direct navigation cue in addition to 1..2...3...4...5 pagination.
I could code it myself but was wondering if there was a decent plugin out there already that would do it for me.
Why can you not have the alphabet for which you want to see the results to, passed as a parameter? And then paginate on the results? That is,
# show results of params[:alphabet] alphabet
@results = fetch_results(params[:alphabet])
# Use Will Paginate to fetch results internally and give a condition that
# fetches results starting with the passed alphabet.
And show paginated results (numbered) using <%= will_paginate @results %>
on the view.
I implemented something like that a while ago (based on the popular will_paginate plugin): Implementing Grouped Links. It can generate links like:
alt text http://www.hennessynet.com/blog/wp-content/uploads/2008/09/letters.png
Note: I haven't updated this to use named scopes (as I didn't need them). If you feel like adding support for them, please send me a patch.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With