title: Rails remote form submits when non-submit button clicked
body: <p>I am creating a remote/ajax form in rails 4. Here is the code:</p>
  
  <pre><code>        &lt;div id="new-email-form-section" class="new-attribute-section"&gt;
              &lt;%= form_for [@user, @contact, @contact_email], :format =&gt; :js, :remote =&gt; true do |f| %&gt;
                &lt;input type="hidden" value="&lt;%= form_authenticity_token %&gt;" name="authenticity_token" /&gt;
                &lt;div class="new-attribute-fields"&gt;
                  &lt;div id="new-email-form-tag"&gt;Label: &lt;%= f.text_field :tag %&gt;&lt;/div&gt;
                  &lt;div id="new-email-form-email"&gt;Email: &lt;%= f.text_field :email %&gt;&lt;/div&gt;
                &lt;/div&gt;
                &lt;div class="new-attribute-btns"&gt;
                  &lt;div id="new-email-submit"&gt;
                    &lt;%= f.submit "Add", :class =&gt; "btn new-attribute-submit-btn" %&gt;
                  &lt;/div&gt;
                  &lt;div id="new-email-cancel"&gt;
                    &lt;button id="new-email-cancel-btn" class="btn new-attribute-cancel-btn"&gt;Cancel&lt;/button&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
              &lt;% end %&gt;
            &lt;/div&gt;
  </code></pre>
  
  <p>This form is hidden and displayed when user clicks a "show" link at the top of the page. Upon clicking the "Cancel" button, the form is again hidden with jQuery/Coffeescript, like so...</p>
  
  <pre><code>$(".new-attribute-cancel-btn").click -&gt;
    $(this).closest(".new-attribute-section").hide()
  </code></pre>
  
  <p>When I click the "Cancel" button, the form is hidden... but the form is also submitted (via ajax). I assume rails is applying submit script to both my submit button as well as my "Cancel" button as it is enclosed within the form tags. Is there any way to avoid this? Or is placing this "Cancel" button within the form itself simply bad form (no pun intended)?</p>