aboutsummaryrefslogtreecommitdiffstats
path: root/actionview
diff options
context:
space:
mode:
authorSergey Prikhodko <prikha@gmail.com>2014-03-03 15:40:16 +0400
committerSergey Prikhodko <prikha@gmail.com>2014-03-03 15:48:48 +0400
commit4a7c8ef793dd5b13026efcc4a5a004bf96b0d1ea (patch)
tree8da106115f6918f00c0a472ec0ee054a0b11ae96 /actionview
parentaa2101ed33438fac494e7fc5510e4465f730ad2b (diff)
downloadrails-4a7c8ef793dd5b13026efcc4a5a004bf96b0d1ea.tar.gz
rails-4a7c8ef793dd5b13026efcc4a5a004bf96b0d1ea.tar.bz2
rails-4a7c8ef793dd5b13026efcc4a5a004bf96b0d1ea.zip
fix button tag without options
Diffstat (limited to 'actionview')
-rw-r--r--actionview/lib/action_view/helpers/form_tag_helper.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionview/lib/action_view/helpers/form_tag_helper.rb b/actionview/lib/action_view/helpers/form_tag_helper.rb
index b3f681e6a7..ccb5c036dc 100644
--- a/actionview/lib/action_view/helpers/form_tag_helper.rb
+++ b/actionview/lib/action_view/helpers/form_tag_helper.rb
@@ -469,7 +469,7 @@ 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? && content_or_options.is_a?(Hash)
+ if block_given?
options = button_tag_options_with_defaults(content_or_options)
content_tag :button, options, &block
else
@@ -744,7 +744,7 @@ module ActionView
def button_tag_options_with_defaults(options)
options = options || {}
- options.stringify_keys!
+ options = options.stringify_keys
default_options = { 'name' => 'button', 'type' => 'submit' }
options.reverse_merge default_options