Will_paginate for a search


I have been trying to use will_paginate with acts_as_ferret and it works
correctly in the first page, but nowhere else. When I try to see the
second or any other page I get a nil object error while evaluating

this is in the controller:

def search_results
if request.post?
@profiles = Profile.find_with_ferret params[:query], :page
=>params[:page], :per_page => 9


and in my view search_results.rhtml I have this:

<%= render(:partial => “shared/sidebar”) %>

<% for profile in @profiles %> <%= link_to profile.name, :controller=>'dogprofile', :action =>'show', :id=>profile %> <%end%> <%= will_paginate @profiles %>

As I said the first results page is ok, somehow It deletes the result
collection when tries to access to another page.

any idea please?


This is a rails question.
Try posting it on the rails community.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs