button_to HTML options not completely intuitive

Tags: 

While working on a site in Rails tonight I was adding a button_to that I wanted a JS confirmation requester. Well, based on my albeit beginner knowledge of Rails I thought the following would work:
[source:ruby]
< %= button_to "Empty Cart", :action => :empty, :confirm => "Really empty your cart?" %>
[/source]
As it turned out this wouldn't work, it kept adding "?confirm=Really empty your cart?" to the URL instead of doing a popup. A bit of fiddling later I realized that to work correctly the additional arguments to button_to need to be arrays, e.g.:
[source:ruby]
< %= button_to "Empty Cart", {:action => :empty}, {:confirm => "Really empty your cart?"} %>
[/source]

How to reply

Care to add your own 2 cents? Let me know via Twitter or my contact page.