in controller:
@users =
User.all.paginate(:page => params[:page], :per_page => 5)
@clients =
Client.all.paginate(:page => params[:page], :per_page => 5)
in view:
<%= will_paginate
@users %>
<%= will_paginate
@clients %>
it will take
params[:page] as param so when click on any of pages of client or
use..both will navigate to another page.
Insted of that,
@users =
User.all.paginate(:page => params[:user_page], :per_page => 5)
@clients =
Client.all.paginate(:page => params[:client_page], :per_page =>
5)
in view:
<%= will_paginate
@users ,
:param_name => '
user_page
'
%>
<%= will_paginate
@clients, :
param_name => '
client_page
'
%>
Now it will work
perfectly...
No comments:
Post a Comment