フォームのインプット要素を全部消して空白にしてくれるすごいボタンをjavascriptで作る前に<input type="reset">と書いてみるべきである。
Railsにはsubmit_tagやtext_field_tagなどがあるが、何故かreset_tagがない。
どうしてもresetボタンが欲しい夜は、以下のようなものを用いる。
helpers/application.rb
def reset_tag(value = "Reset form", options = {})
options = options.stringify_keys
tag :input, { "type" => "reset", "value" => value }.update(options)
end