views:

68

answers:

1

Does anyone know how to eliminate the x and y params when you use image_submit_tag with a get method?

I have a simple search form, and using get to pass the value in the url. When I use image_submit_tag, it also appends the x and y coords, so I get urls like

http://example.com?q=somesearchterm&x=15&y=12

When I have used submit_tag, I can use the :name => nil attribute (was in one of Ryan Bates' Railscasts), but it doesn't seem to work for image_submit_tag. Granted it doesn't affect functionality, but I don't need them and would like them quieted.

A: 

That's actually part of HTML and the browser, not Rails. There is not much you can do apart from change your use of the image_submit or intercept the form submission with JS and edit the parameters. You may also be able to use a regular submit and style it using CSS to display an image, or use an image and attach JS to it to submit the form.

Toby Hede