# Will\_paginate problem

**URL:** <https://www.ruby-forum.com/t/will-paginate-problem/159816>\
**Category:** Rails\
**Created:** [February 9, 2009, 7:22am UTC](https://www.ruby-forum.com/t/will-paginate-problem/159816 "2009-02-09T07:22:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![srikanth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f9ae1b/32.png) [@srikanth](https://www.ruby-forum.com/u/srikanth)\
**Post date:** [February 9, 2009, 7:22am UTC](https://www.ruby-forum.com/t/will-paginate-problem/159816/1 "2009-02-09T07:22:50Z")

</div>

Hi All,

I have implemented application for searching the streams from  
database.And tryng to implement the pagination on the result page.

In my index page i have drop down boxes created using form tags .I can  
select a parameter from each drop down box and i can search for  
streams based on selected parameters.And the results are displayed in  
view page.

If i select only one parameter the streams are displaying in the view  
page and pagination is happening fine.

ex:drop down box name - contenttype ,here by using  
in index page:  
\<%= select\_tag ‘contenttype’, options\_for\_select(  
[[‘Select one value’,‘Select one value’],  
[‘video’,‘video’],  
[‘image’,‘image’],  
[‘speech’,‘speech’],  
[‘audio’,‘audio’]],to\_s), :onchange =\> “switchDiv(value);” %\>

in views:

\<%= will\_paginate(@streams, :param\_name =\> ‘page’,:params =\>  
{:contenttype =\> params[:contenttype]}) -%\>

But here the problem is if i selected two parameters for search how  
can i use the will\_paginate.And for every search the result is  
collected in @streams.So here the same logic i could not able to use ,  
because the params are more than one.

ex:  
i selected parameters from dropdown box names contenttype &  
containertype.

here how to use will\_paginate to support multiple params.

Can any one suggest me to solve this problem.Is it possible  
will\_paginate can be used for pagination based on search results.

Thanks and regards  
Srikanth
