Tim
Tim

Reputation: 6209

Rails 3 Pagination for NON-ActiveRecord results

My rails 3 app uses sphinx to perform search on text files, and I return a collection of results on the landing page view: something like

<%= render :partial => "result", :collection => @results %>

What is the Rails way to do pagination for the results? I know there are plugins like will_paginate, but I'm not using ActiveRecord (my app doesn't even use a db).

Is a Javascript solution the best way to go? I want to also maintain REST in the url, ie "/search?query=hello&page=2"

Upvotes: 0

Views: 1555

Answers (1)

Zabba
Zabba

Reputation: 65467

Here is someone who has already done so: How to use will_paginate with non-ActiveRecord collection/array

Upvotes: 1

Related Questions