title: Rails 3 - Javascript :confirm not working for link_to and button_to with :method => :delete
body: <p>In my index.html.erb file I'm trying to display the title to my object (a "listing") and the normal "show", "edit", and "destroy" links and/or buttons.  With :method => :delete and :confirm => "are you sure?", neither link_to or button_to will present the javascript confirmation box.  Here is my index.html.erb:</p>
  
  <pre><code>&lt;h2&gt;&lt;a href="#" onclick="alert('Hello world!'); return false;"&gt;Click Here for a Javascript test&lt;/a&gt;&lt;/h2&gt;   
  &lt;table&gt;  
    &lt;tr&gt;
      &lt;th&gt;List Title&lt;/th&gt;
      &lt;th&gt;&lt;/th&gt;
      &lt;th&gt;&lt;/th&gt;
      &lt;th&gt;&lt;/th&gt;
    &lt;/tr&gt;    
  &lt;% @listings.each do |listing| %&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;%= listing.title %&gt;&lt;/td&gt;
      &lt;td&gt;&lt;%= button_to 'Show', listing %&gt;&lt;/td&gt;
      &lt;td&gt;&lt;%= button_to 'Edit', edit_listing_path(listing) %&gt;&lt;/td&gt;
      &lt;td&gt;&lt;%= button_to( 'Destroy', listing, 
                         :confirm =&gt; 'Are you sure?', :method =&gt; :delete)%&gt; &lt;/td&gt;
      &lt;td&gt;&lt;%= link_to "Destroy", listing, :confirm =&gt; "Are you sure?", :method =&gt; :delete %&gt; &lt;/td&gt;
    &lt;/tr&gt;
  &lt;% end %&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>The "Hello World" JS confirmation link at the top of the listing works perfectly, so I'm pretty sure that unobtrusive javascript is working fine for my app. (I also confirmed I have the necessary-- javascript_include_tag :defaults  and csrf_meta_tag are in my application template.)  The Rails documentation confirms the arguments that I'm using are supported (url, :confirm, :method).  However neither button_to or link_to will generate the JS alert indicated by :confirm.  One other bit of strangeness, with the exact same arguments, button_to will delete a record while link_to does not.</p>
  
  <p>Any suggestions on what to investigate to fix this would be appreciated.</p>
  
  <p>Thanks!</p>