In my Rails view, I have an HTML form
<form name="input">
Username: <input type="text" name="user"> <br/>
<input type="button" id="submit_form" value="Submit">
</form>
When the submit button is clicked, I want to use JQuery to call the controller download, and also pass along the user parameter. (In routes.rb I specify match "download" => "Posts#download")
How should I use JQuery to do this?
$("#submit_form").click(function() {
// what should I put here?
});
You could do this:
Source: Modified example from jQuery docs