Forum: Ruby on Rails pagination problem using will_paginate with two models

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
srikanth (Guest)
on 2009-02-05 06:25
(Received via mailing list)

let me explain my application details:

I have two controllers:

And i have two models:

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?

This topic is locked and can not be replied to.