diff options
author | Sergey Prikhodko <prikha@gmail.com> | 2014-03-03 17:16:28 +0400 |
---|---|---|
committer | Sergey Prikhodko <prikha@gmail.com> | 2014-03-03 17:16:28 +0400 |
commit | ed4fc43287562efab01a903507cd0b9d19388a74 (patch) | |
tree | b0d13408e1bd3c27676c66afa6ccea2a51ffe0e4 /actionview/lib/action_view/helpers | |
parent | 28c0177524d68844713086ea1343718916ad97a8 (diff) | |
download | rails-ed4fc43287562efab01a903507cd0b9d19388a74.tar.gz rails-ed4fc43287562efab01a903507cd0b9d19388a74.tar.bz2 rails-ed4fc43287562efab01a903507cd0b9d19388a74.zip |
fix content_or_options to be replaced by options and set to nil
Diffstat (limited to 'actionview/lib/action_view/helpers')
-rw-r--r-- | actionview/lib/action_view/helpers/form_tag_helper.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/form_tag_helper.rb b/actionview/lib/action_view/helpers/form_tag_helper.rb index 5136e4dda4..4113acc6e9 100644 --- a/actionview/lib/action_view/helpers/form_tag_helper.rb +++ b/actionview/lib/action_view/helpers/form_tag_helper.rb @@ -469,7 +469,12 @@ module ActionView # # => <button data-disable-with="Please wait..." name="button" type="submit">Checkout</button> # def button_tag(content_or_options = nil, options = nil, &block) - options = content_or_options.is_a?(Hash) ? content_or_options : options + + if content_or_options.is_a?(Hash) + options = content_or_options + content_or_options = nil + end + options = button_tag_options_with_defaults(options) content_tag :button, content_or_options || 'Button', options, &block end |