Safely persisting query parameters in Rails 3.1

I’m working on a project (Active Admin) that needs to be able to build
links on the page (e.g. pagination) that include arbitrary query
that the user has entered.

Since url_for symbolizes any keys passed to it, for obvious memory
concerns you can’t just pass the entire params hash.

In Rails 3.2, however, you can do this:

include Rails.application.routes.url_helpersurl_for action: ‘index’,
controller: ‘employees’, host: ‘’, params: {‘eee’ => 3}# =>
‘eee’# => false

In other words, you can pass params: request.query_parameters to
url_for to avoid the potential DOS issue.

However we still support Rails 3.0 and 3.1, and they completely ignore

Save for monkeypatching, has anyone found a way to safely provide this

Sean Linsley