title: Rails 5: Submit form with jQuery
body: <p>I am trying to submit a form with jQuery if any of the element changes. For now I am not using <code>remote: true</code>.</p>
  
  <p>Here is the code that renders the partial:</p>
  
  <pre><code>views/assets/index.html.erb
  &lt;%= render @assets %&gt;
  </code></pre>
  
  <p>Code for partial:</p>
  
  <pre><code>views/assets/_asset.html.erb
  &lt;%= form_for [asset.project, asset] do |f| %&gt;
    ...
  &lt;% end %&gt;
  </code></pre>
  
  <p>Following is the javascript code for form submit:</p>
  
  <pre><code>$(document).on('turbolinks:load', function() {
    if (!($(".assets.index").length &gt; 0)) return;
  
    $('.edit_asset').change(function() {
      alert("submitting..");
      $(this).submit();
    });
  });
  </code></pre>
  
  <p>It's doing the <code>alert</code> but form is not getting submitted, please suggest..</p>
  
  <p><a href="https://i.stack.imgur.com/ac9Zd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ac9Zd.png" alt="enter image description here"></a></p>