Ruby on Rails: image_submit_tag and :confirm

I was told about an issue today with the image_submit_tag not supporting the :confirm method on the element:

<%= image_submit_tag('buttons/submit.gif', { :confirm => 'Are you sure?' }) %>

so I thought I’d share a quick fix which would be the actual javascript returned by the function:

<%= image_submit_tag('buttons/submit.gif', { :onclick => 'return
confirm(\'Are you sure?\');' }) %>

Hope this can save some people time…