Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
will_paginate for a search
Javi Jimenez
3/14/2008 6:11:00 PM
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-...
.
1 Answer
Rodrigo Bermejo
3/14/2008 7:18:00 PM
0
This is a rails question.
Try posting it on the rails community.
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
will_paginate for a search
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password