title: rails - How to use onsubmit with form_tag
body: <p>I want to convert below code to <code>form_for</code> or <code>form_tag</code>.</p>
  
  <pre><code>&lt;form onsubmit="foo()"&gt;
  </code></pre>
  
  <p>What should I do? I don't want to connect another page(action="/URL").</p>
  
  <p>I just want <code>function foo()</code> to fire when this form is submitted.</p>