Is there a way to capture the querystring and send that along as part of a form post? I\'m using Rails 2.3.5 and my user is on a page that has multiple querystring parameters. O
hidden_field_tag
if you're using a GET
request.In our case we were using a simple form with a select for setting the Per Page values for pagination. We found that any existing GET params were cleared when submitting this form. To fix this we used hidden_field_tag
s in our form.
Inside of your form, just set hidden_field_tags
for the existing GET
params, like so:
form_content = request.query_parameters.collect do |key, value|
hidden_field_tag key, value
end
This will ensure that your existing params persist.