:confirm not working in my button_to

I wrote in my view : (haml)

= button_to I18n.t(:cancel_my_account), user_registration_path(resource), :confirm => I18n.t(:are_you_sure), :method => :delete, :title =>I18n.t(:cancel_my_account)

which generates the html code : <form method="post" action="/users.4cfc1725a326cb1d3200000a? locale=en" class="button_to"> <div> <input name="_method" type="hidden" value="delete" /> <input data-confirm="Are you sure?" title="Cancel my account" type="submit" value="Cancel my account" /> <input name="authenticity_token" type="hidden" value="V +oNGXlJirt0WmgkDJRKzUcCMzSIpoxPfJ48NUyWgqU=" /> </div> </form>

but the confirm panel doesn't show up... it goes directly to the delete action .. any clue ?

thanks fyh.

note : I have the csrf tags in my <head>

Are you including the javascript libraries? In your layout you should have something like javascript_include_tag :defaults Check in the htlm to make sure the libraries are there.

If you have then have you got javascript enabled in your browser?

If yes then check the html for validity by copying the complete page html and pasting into the w3c html vallidator. In fact this is a good idea even you have fixed the problem by one of the above.

Check for javascript bugs by loading the page with firebug addon enabled in firefox.