submitting form with link_to

I want to submit a form using link_to. I dont want to use <%= submit_tag "Add" %>. Instead of that i want to create a "link_to "Add", .....". so please let me know how to make it. I also want to use an image for delete link. How i should do that?

Sumeru wrote:

I want to submit a form using link_to. I dont want to use <%= submit_tag "Add" %>. Instead of that i want to create a "link_to "Add", .....". so please let me know how to make it. I also want to use an image for delete link. How i should do that?

Hi Sumeru, You can do that by giving your form an id (or enclose it in a <div> with an id, and adding :submit => '<id of the form/div>' in the link_to parameters. I don't know what HTTP action it defaults to, but you can also specify that by using :html => { :method => :post}.

Good luck!

Peter