title: How come the Javascript for my Rails button_to button doesn't work?
body: <p>I am having styling issues with my button.  Currently I have this:</p>
  
  <pre><code>&lt;%= link_to t(:add_to_cart), '#', :onclick =&gt; "$(this).parent().submit(); return false;", :type =&gt; "button", :class =&gt; "button primary" %&gt;
  </code></pre>
  
  <p>which renders this:</p>
  
  <pre><code>&lt;a href="#" class="button" onclick="$(this).parent().submit(); return false;"&gt;Add To Cart&lt;/a&gt;
  </code></pre>
  
  <p>when I change the link_to to a button_to, I've got this:</p>
  
  <pre><code>&lt;%= button_to t(:add_to_cart), '#', :onclick =&gt; "$(this).parent().submit(); return false;", :type =&gt; "button", :class =&gt; "button primary" %&gt;
  </code></pre>
  
  <p>which renders this:</p>
  
  <pre><code>&lt;input class="button primary" onclick="$(this).parent().submit(); return false;" type="submit" value="Add To Cart"&gt;
  </code></pre>
  
  <p>Unfortunately, the javascript no longer works. I can see the obvious change in the markup, but why does this no longer work? I'm a designer that dabbles in Rails, so please be gentle!  Seems like this could be something pretty simple.  I did try :url => '#' on the button_to, which gave me other styling issues, so I reverted.</p>