hi! 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 nil.each. this is in the controller: def search_results if request.post? @profiles = Profile.find_with_ferret params[:query], :page =>params[:page], :per_page => 9 end and in my view search_results.rhtml I have this: <%= render(:partial => "shared/sidebar") %> <td width="462" valign="top" > <% for profile in @profiles %> <td width ="146 px" height="99 px" align = "center"> <%= link_to profile.name, :controller=>''dogprofile'', :action =>''show'', :id=>profile %> </td> <%end%> <%= will_paginate @profiles %> </td> 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? thanks! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
>> def search_results >> if request.post?You''re requiring a POST for your search results; the pagination links are just normal hyperlinks (i.e. GET requests). Either change your method to allow GET or hack will_paginate to render links that generate a POST request (not recommended IMHO) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jeff Emminger wrote:>>> def search_results >>> if request.post? > > You''re requiring a POST for your search results; the pagination links > are just normal hyperlinks (i.e. GET requests). Either change your > method to allow GET or hack will_paginate to render links that > generate a POST request (not recommended IMHO)Thanks Jeff! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---