aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/tag_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view/helpers/tag_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/tag_helper.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/tag_helper.rb b/actionpack/lib/action_view/helpers/tag_helper.rb
index f7afa48256..1eeff38ab8 100644
--- a/actionpack/lib/action_view/helpers/tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/tag_helper.rb
@@ -137,6 +137,12 @@ 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 = []