title: Submit form using link_to in rails
body: <p>I'm trying to submit a form using link_to as follows:</p>
  
  <pre><code> &lt;%= form_for(@post,  :url=&gt; '/post/action', :method=&gt; 'post', :html =&gt; {:id=&gt;'form_id'} ) do |f| %&gt;
    ....
  
   &lt;%= link_to 'submit', "/post/action", :onclick=&gt;"document.getElementById('form_id').submit()" %&gt;
  
    ....
  </code></pre>
  
  <p>but it is not posting the form, it is simply redirecting my form to the specified url. Does anyone know how to do this?</p>