diff options
author | José Valim <jose.valim@gmail.com> | 2012-05-12 14:42:35 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-05-12 14:42:35 +0200 |
commit | eab0520e132e373618f6e3ce585ebd71ec501e97 (patch) | |
tree | 259dc98963312cfa2ae73e96f92f19d94c1815b6 /actionpack/lib/action_view | |
parent | 3a59eab5f78f4c11915eba150c88ce384d046dff (diff) | |
download | rails-eab0520e132e373618f6e3ce585ebd71ec501e97.tar.gz rails-eab0520e132e373618f6e3ce585ebd71ec501e97.tar.bz2 rails-eab0520e132e373618f6e3ce585ebd71ec501e97.zip |
Revert "Merge pull request #6142 from spartan-developer/master"
This reverts commit 667d0bdd90ef6e6b691f0cc4cf5535b8da69f248, reversing
changes made to 4ae6bab6bb02c9390188a49f9a749400f6a0ac94.
Diffstat (limited to 'actionpack/lib/action_view')
4 files changed, 12 insertions, 10 deletions
diff --git a/actionpack/lib/action_view/helpers/asset_tag_helper.rb b/actionpack/lib/action_view/helpers/asset_tag_helper.rb index 5f1f08d19c..adc62ec6a9 100644 --- a/actionpack/lib/action_view/helpers/asset_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/asset_tag_helper.rb @@ -393,7 +393,9 @@ module ActionView options[:alt] = options.fetch(:alt){ image_alt(src) } end - extract_size!(options, :width, :height) + if size = options.delete(:size) + options[:width], options[:height] = size.split("x") if size =~ %r{^\d+x\d+$} + end if mouseover = options.delete(:mouseover) options[:onmouseover] = "this.src='#{path_to_image(mouseover)}'" @@ -446,7 +448,9 @@ module ActionView multiple_sources_tag('video', sources) do |options| options[:poster] = path_to_image(options[:poster]) if options[:poster] - extract_size!(options, :width, :height) + if size = options.delete(:size) + options[:width], options[:height] = size.split("x") if size =~ %r{^\d+x\d+$} + end end end diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionpack/lib/action_view/helpers/form_tag_helper.rb index 7cdb09d7d2..248cc2f6a3 100644 --- a/actionpack/lib/action_view/helpers/form_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/form_tag_helper.rb @@ -317,7 +317,9 @@ module ActionView def text_area_tag(name, content = nil, options = {}) options = options.stringify_keys - extract_size!(options, 'cols', 'rows') + if size = options.delete("size") + options["cols"], options["rows"] = size.split("x") if size.respond_to?(:split) + end escape = options.delete("escape") { true } content = ERB::Util.html_escape(content) if escape diff --git a/actionpack/lib/action_view/helpers/tag_helper.rb b/actionpack/lib/action_view/helpers/tag_helper.rb index 1eeff38ab8..f7afa48256 100644 --- a/actionpack/lib/action_view/helpers/tag_helper.rb +++ b/actionpack/lib/action_view/helpers/tag_helper.rb @@ -137,12 +137,6 @@ module ActionView "<#{name}#{tag_options}>#{PRE_CONTENT_STRINGS[name.to_sym]}#{content}</#{name}>".html_safe end - def extract_size!(options, x_attribute, y_attribute) - if size = options.delete(:size) - options[x_attribute], options[y_attribute] = size.split("x") if size =~ %r{^\d+x\d+$} - end - end - def tag_options(options, escape = true) return if options.blank? attrs = [] diff --git a/actionpack/lib/action_view/helpers/tags/text_area.rb b/actionpack/lib/action_view/helpers/tags/text_area.rb index 160f020263..f74652c5e7 100644 --- a/actionpack/lib/action_view/helpers/tags/text_area.rb +++ b/actionpack/lib/action_view/helpers/tags/text_area.rb @@ -6,7 +6,9 @@ module ActionView options = @options.stringify_keys add_default_name_and_id(options) - extract_size!(options, 'cols', 'rows') + if size = options.delete("size") + options["cols"], options["rows"] = size.split("x") if size.respond_to?(:split) + end content_tag("textarea", options.delete('value') || value_before_type_cast(object), options) end |