I usually use will_paginate to paginate in my application, but hit stumbler in my search function. I use Thinking Sphinx to perform a full-text search that returns paginated results. The problem I am facing is that after I got the results from Thinking Sphinx, I need to combine them with some other results and reorder them.
As soon as I finish processing them, I have an array of results that is very different from the original from TS. Since there can be 1000 results in this array, this is necessary. The problem is that I cannot figure out how to get will_paginate to play with the existing array.
I did some research, and it seems that the only solutions to this problem are several years ago and are based on the old Paginator built-in class. The very last one I could find that will_paginate uses has been from devchix since mid-2007: http://www.devchix.com/2007/07/23/will_paginate-array/comment-page-1/ - I gave it but for me it does nothing.
Are there any current methods for applying pagination (preferably through will_paginate) for existing arrays of AR results?
ruby-on-rails activerecord pagination thinking-sphinx will-paginate
Saucyk
source share