Will_paginate after POST

Hi,

I’m using will_paginate in order to paginate the results of a search. My
problem is that when I click Next, will_paginate “forgets” what I was
searching and shows the results as is nothing were searched. In other
words, how can I use will_paginate in order to use the same first
@variable when the user clicks Next or a page number?

Thanks

Juan K. wrote:

Hi,

I’m using will_paginate in order to paginate the results of a search. My
problem is that when I click Next, will_paginate “forgets” what I was
searching and shows the results as is nothing were searched. In other
words, how can I use will_paginate in order to use the same first
@variable when the user clicks Next or a page number?

Thanks

Hi Juan,
I have faced same problem like you. You can pass the parameter this
way to solve out your problem.
<%= will_paginate @users, :params=>{:page_size =>
params[:page_size],:with_all_of_these_words =>
params[:with_all_of_these_words]} %>

Here, :will_all_of_these_words it’s my textbox id with that i was doing
searching.
So you can pass the params this way with will_paginate.So you need to
just pass your textbox values this way and may be your pagination will
work fine.

And i am new.so let me know if i am wrong at somewhere.