How do I create a submit action in form not by a button (with submit_tag) and not by an image (image_submit_tag)?
I’d like the submit to be clickable text like a link
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You would need to do that with javascript, since links are a GET request, not a post request. So let’s say you have the following code:
You then need to add the following to one of your javascript files. If you’re using < Rails 3.1, just simply add this to your application.js. If you’re using Rails 3.1, add it to one of the js files in assets/javascripts directory.
That said, you can pass the method option into a link_to method call, to use POST. However, just doing that without javascript will not submit any of the form data. So you would either have to do the above, or use javascript to add the data to the url like you would in a query string.