Will_paginate problem


#1

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