From aa2101ed33438fac494e7fc5510e4465f730ad2b Mon Sep 17 00:00:00 2001 From: Sergey Prikhodko Date: Mon, 3 Mar 2014 14:57:41 +0400 Subject: fix accept nil options --- actionview/lib/action_view/helpers/form_tag_helper.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'actionview') 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 -- cgit v1.2.3