Making a form reset button in Rails


Rails doesn't have reset_tag to automatically make a form reset button, instead you have to take a slightly different route. To make a form reset button in Rails you simply do this:
'reset', :id => 'reset_button', :type => "reset" }) %>
which will create the following:

The important part here is the :type argument, which override's Rails' default of "submit" for the submit_tag. Then, to tidy it up a little I override the :name, which defaults to "commit", and give it a useful id attribute.

Et voila!

How to reply

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