Topic: Passing mutiple params between pages - pagination

I've got quite a complex search page which uses pagination, I need to pass all the search parameters in the query string for each paging link. I want a solution which will pass all parameters without knowing what they are in advance, so everything except for the page parameter which need to be updated with the relevant page which it links to. I did this in ASP ages ago, but I can't seem to access the right variable in Rails. Thanks

input
?q=foo&c=0&d=5&pd=SE15&u=aubergene&s=0&page=13

output
<a href="?q=foo&c=0&d=5&pd=SE15&u=aubergene&s=0&page=12">previous</a>
<a href="?q=foo&c=0&d=5&pd=SE15&u=aubergene&s=0&page=14">next</a>

Re: Passing mutiple params between pages - pagination

Try specifying the :overwrite_params option:

<%= link_to 'Next Page', :overwrite_params => { :page => '...' } %>

Railscasts - Free Ruby on Rails Screencasts

Re: Passing mutiple params between pages - pagination

Many thanks, just what I was looking for. It should be included as an example in the API.