diff options
author | Sergey Prikhodko <prikha@gmail.com> | 2014-03-03 14:57:41 +0400 |
---|---|---|
committer | Sergey Prikhodko <prikha@gmail.com> | 2014-03-03 14:57:41 +0400 |
commit | aa2101ed33438fac494e7fc5510e4465f730ad2b (patch) | |
tree | 3a75bf89af5e9dbf6f2d62a2e2a7278c3070dae1 /actionview | |
parent | 60bbbce7a302c18d3ab8b7450f94cabc9bbea835 (diff) | |
download | rails-aa2101ed33438fac494e7fc5510e4465f730ad2b.tar.gz rails-aa2101ed33438fac494e7fc5510e4465f730ad2b.tar.bz2 rails-aa2101ed33438fac494e7fc5510e4465f730ad2b.zip |
fix accept nil options
Diffstat (limited to 'actionview')
-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 |