Forum: Ruby on Rails will_paginate problem

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E38118c6d20b4544e424fd700571e090?d=identicon&s=25 srikanth (Guest)
on 2009-02-09 07:22
(Received via mailing list)
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
This topic is locked and can not be replied to.