diff options
-rw-r--r-- | actionview/lib/action_view/helpers/form_tag_helper.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/actionview/lib/action_view/helpers/form_tag_helper.rb b/actionview/lib/action_view/helpers/form_tag_helper.rb index bb38ae8555..b3f681e6a7 100644 --- a/actionview/lib/action_view/helpers/form_tag_helper.rb +++ b/actionview/lib/action_view/helpers/form_tag_helper.rb @@ -742,10 +742,12 @@ module ActionView name.to_s.delete(']').gsub(/[^-a-zA-Z0-9:.]/, "_") end - def button_tag_options_with_defaults(options = {}) - default_options = { 'name' => 'button', 'type' => 'submit' } + def button_tag_options_with_defaults(options) + options = options || {} options.stringify_keys! - options.reverse_merge! default_options + + default_options = { 'name' => 'button', 'type' => 'submit' } + options.reverse_merge default_options end end end |