diff options
author | Sergey Prikhodko <prikha@gmail.com> | 2014-03-03 16:33:24 +0400 |
---|---|---|
committer | Sergey Prikhodko <prikha@gmail.com> | 2014-03-03 16:33:24 +0400 |
commit | 51ff88cf6ae72c8c09145b0c0cba1e154d3068f1 (patch) | |
tree | 3d4fc642101a26eceab0fd6991308610e8a13b79 /actionview/lib/action_view | |
parent | 4a7c8ef793dd5b13026efcc4a5a004bf96b0d1ea (diff) | |
download | rails-51ff88cf6ae72c8c09145b0c0cba1e154d3068f1.tar.gz rails-51ff88cf6ae72c8c09145b0c0cba1e154d3068f1.tar.bz2 rails-51ff88cf6ae72c8c09145b0c0cba1e154d3068f1.zip |
fix form button
Diffstat (limited to 'actionview/lib/action_view')
-rw-r--r-- | actionview/lib/action_view/helpers/form_tag_helper.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/actionview/lib/action_view/helpers/form_tag_helper.rb b/actionview/lib/action_view/helpers/form_tag_helper.rb index ccb5c036dc..9f2eb49f72 100644 --- a/actionview/lib/action_view/helpers/form_tag_helper.rb +++ b/actionview/lib/action_view/helpers/form_tag_helper.rb @@ -469,12 +469,9 @@ module ActionView # # => <button data-disable-with="Please wait..." name="button" type="submit">Checkout</button> # def button_tag(content_or_options = nil, options = nil, &block) - if block_given? - options = button_tag_options_with_defaults(content_or_options) - content_tag :button, options, &block - else + options = content_or_options.is_a?(Hash) ? content_or_options : options options = button_tag_options_with_defaults(options) - content_tag :button, content_or_options || 'Button', options + content_tag :button, content_or_options || 'Button', options, &block end end |