Pagination problem using will_paginate with two models


#1

Hi,

let me explain my application details:

I have two controllers:
1.streams_controller
2.search_controller

And i have two models:
1.stream.rb
2.search.rb

in streams_controller, i am uploading and downloading streams
in search controller i am searching the streams from database.

Here i have used will_paginate plugin for pagination in streams
controller.It is working fine.
to make it work i have added below code :

in controller:
@streams = Stream.paginate(:page => params[:index],:per_page => 2)

in view page:
<%= will_paginate(@streams, :param_name => ‘index’) -%>

But in search controller if i use pagination its not happening .Simply
it is showing the page number on display page .

i have added below code :
in controller:
@test2 = Stream.paginate(:page => params[:get_results],:per_page => 2)
in view page:
<%= will_paginate(@test2, :param_name => ‘get_results’) -%>

here i am using same model ‘stream’ and collecting in test2.
what could be the problem?
Can any one suggest me to make it work?

thanks
Srikanth