From 03749d6c88ae8312dc959b7683851dbf8c969326 Mon Sep 17 00:00:00 2001 From: Tom Stuart Date: Sat, 12 Feb 2011 11:34:49 +0000 Subject: Make type="submit" the default for button_tag helper "submit" is the default value of the + # # => # - # button_tag "Ask me!" + # button_tag "Ask me!", :type => 'button' # # => # # button_tag "Checkout", :disable_with => "Please wait..." # # => + # type="submit">Checkout # def button_tag(label = "Button", options = {}) options.stringify_keys! @@ -453,9 +453,7 @@ module ActionView options["data-confirm"] = confirm end - ["type", "name"].each do |option| - options[option] = "button" unless options[option] - end + options.reverse_merge! 'name' => 'button', 'type' => 'submit' content_tag :button, label, { "type" => options.delete("type") }.update(options) end -- cgit v1.2.3