Rails - Alphabetical Paging / Navigation

Is there a rails plugin that will do alphabetical pagination / navigation?

I have a very large data set and you would prefer something that would give users a more direct navigation hint in addition to 1..2 ... 3 ... 4 ... 5 pagination.

I could have encoded it myself, but I was wondering if there was a decent plugin that would do it for me.

+6
plugins ruby-on-rails pagination
source share
2 answers

Why don't you have the alphabet for which you want to see the results passed as a parameter? And then break the pages into results? I.e

# 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 the broken pages (numbered) with <%= will_paginate @results %> in the view.

+4
source share

I implemented something similar before (based on the popular will_paginate plugin): Implementing grouped links . It can generate links such as:

alt text http://www.hennessynet.com/blog/wp-content/uploads/2008/09/letters.png

Note. I did not update this to use the named areas (since I do not need them). If you want to add support, send me a patch.

+1
source share

All Articles