# Will\_paginate after POST

**URL:** <https://www.ruby-forum.com/t/will-paginate-after-post/179611>\
**Category:** Rails\
**Created:** [November 30, 2009, 12:54pm UTC](https://www.ruby-forum.com/t/will-paginate-after-post/179611 "2009-11-30T12:54:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kinunt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/7c8e57/32.png) [@kinunt](https://www.ruby-forum.com/u/kinunt)\
**Post date:** [November 30, 2009, 12:54pm UTC](https://www.ruby-forum.com/t/will-paginate-after-post/179611/1 "2009-11-30T12:54:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kinunt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/7c8e57/32.png) [@kinunt](https://www.ruby-forum.com/u/kinunt)\
**Post date:** [November 30, 2009, 1:46pm UTC](https://www.ruby-forum.com/t/will-paginate-after-post/179611/2 "2009-11-30T13:46:30Z")

</div>

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.
