Pagination not keeping search params?

Hi

I have the following pagination search query

@user_pages, @users = paginate :users, :per_page => 2,
:conditions => “name LIKE ‘#{params[‘search’][‘name’]}%’”

When ever I click on page 2 the params[‘search’][‘name’] is no longer
available, how can I pass this overto the next page?

Cheers
jon

Hi Jon,

I am in trouble with the same problem.

Please have look on this problem which i have posted on this group.

If you have got the solution please tell me.

Regards,
Manohar.

manohar amrutkar wrote:

Hi Jon,

I am in trouble with the same problem.

Please have look on this problem which i have posted on this group.

If you have got the solution please tell me.

Regards,
Manohar.

Hey,

I got around this by writing the params to a session and then using that
in my query

Thanks.

I did the same and its working

On Feb 7, 6:21 pm, Scott H. [email protected]

that is exactly what i did as well.

Scott H. wrote:

manohar amrutkar wrote:

Hi Jon,

I am in trouble with the same problem.

Please have look on this problem which i have posted on this group.

If you have got the solution please tell me.

Regards,
Manohar.

Hey,

I got around this by writing the params to a session and then using that
in my query

Hello, you can try also overwrite parameter :page, like this:
Link to the first page:
link_to image_tag("/images/first_page.gif", :border => 0, :title =>
“Navigate to the first page”), {:overwrite_params => {:page =>
@pages.first}} if (@pages.current.number != 1)
Previous page:
link_to image_tag("/images/previous_page.gif", :border => 0, :title =>
“Navigate to the previous page”), {:overwrite_params => {:page =>
@pages.current.previous}} if @pages.current.previous
Pages with number:
pagination_links(@pages, {:window_size =>
@window_size, :always_show_anchors => false, :params => @params})
Next page:
link_to image_tag("/images/next_page.gif", :border => 0, :title =>
“Navigate to the next page”), {:overwrite_params => {:page =>
@pages.current.next}} if @pages.current.next
Last Page:
link_to image_tag("/images/last_page.gif", :border => 0, :title =>
“Navigate to the last page”), {:overwrite_params => {:page =>
@pages.last}} if (@pages.current.number != @pages.last.number)
Best Regards, Sergey.