aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2015-03-18 07:30:26 -0300
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2015-03-18 07:34:16 -0300
commite121fae9662a40bbf63c204148ad2296b09fdfdc (patch)
tree1fcda930c87a7c1d94af9eeb6e41f8ec55a1cd28 /actionview/lib/action_view/helpers
parent08615a3bcbe57b99881f6f3f5b649ed413b9307b (diff)
downloadrails-e121fae9662a40bbf63c204148ad2296b09fdfdc.tar.gz
rails-e121fae9662a40bbf63c204148ad2296b09fdfdc.tar.bz2
rails-e121fae9662a40bbf63c204148ad2296b09fdfdc.zip
Remove additional handling of boolean attributes on button to helper
This logic was just doing duplicated work, since the button_to helper relies on tag/content_tag to generate the button html, which already handles all boolean attributes it knows about. The code dates back to 2005: 43c470fae468ef63e0d5c3dc1e202925685fd47b.
Diffstat (limited to 'actionview/lib/action_view/helpers')
-rw-r--r--actionview/lib/action_view/helpers/url_helper.rb30
1 files changed, 0 insertions, 30 deletions
diff --git a/actionview/lib/action_view/helpers/url_helper.rb b/actionview/lib/action_view/helpers/url_helper.rb
index 3dbce0738e..4c436bce25 100644
--- a/actionview/lib/action_view/helpers/url_helper.rb
+++ b/actionview/lib/action_view/helpers/url_helper.rb
@@ -280,9 +280,7 @@ module ActionView
html_options, options = options, name if block_given?
options ||= {}
html_options ||= {}
-
html_options = html_options.stringify_keys
- convert_boolean_attributes!(html_options, %w(disabled))
url = options.is_a?(String) ? options : url_for(options)
remote = html_options.delete('remote')
@@ -576,34 +574,6 @@ module ActionView
html_options["data-method"] = method
end
- # Processes the +html_options+ hash, converting the boolean
- # attributes from true/false form into the form required by
- # HTML/XHTML. (An attribute is considered to be boolean if
- # its name is listed in the given +bool_attrs+ array.)
- #
- # More specifically, for each boolean attribute in +html_options+
- # given as:
- #
- # "attr" => bool_value
- #
- # if the associated +bool_value+ evaluates to true, it is
- # replaced with the attribute's name; otherwise the attribute is
- # removed from the +html_options+ hash. (See the XHTML 1.0 spec,
- # section 4.5 "Attribute Minimization" for more:
- # http://www.w3.org/TR/xhtml1/#h-4.5)
- #
- # Returns the updated +html_options+ hash, which is also modified
- # in place.
- #
- # Example:
- #
- # convert_boolean_attributes!( html_options,
- # %w( checked disabled readonly ) )
- def convert_boolean_attributes!(html_options, bool_attrs)
- bool_attrs.each { |x| html_options[x] = x if html_options.delete(x) }
- html_options
- end
-
def token_tag(token=nil)
if token != false && protect_against_forgery?
token ||= form_authenticity_token