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

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs