aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers
diff options
context:
space:
mode:
authorMehdi Lahmam <mehdi@craftsmen.io>2015-02-15 21:38:27 +0100
committerMehdi Lahmam <mehdi@craftsmen.io>2015-02-16 12:58:34 +0100
commitab5f119ac62cdbcc3c9d5c4fd36dafd187b038ca (patch)
treed112b9e216513e3aad6f8b161f432bbcd918252a /actionview/lib/action_view/helpers
parent1747c4e2cea811cbf04fccc9f57256c80112d9ce (diff)
downloadrails-ab5f119ac62cdbcc3c9d5c4fd36dafd187b038ca.tar.gz
rails-ab5f119ac62cdbcc3c9d5c4fd36dafd187b038ca.tar.bz2
rails-ab5f119ac62cdbcc3c9d5c4fd36dafd187b038ca.zip
Allow to pass a string value to size option in `image_tag` and `video_tag`
This makes the behavior more consistent with `width` or `height` options
Diffstat (limited to 'actionview/lib/action_view/helpers')
-rw-r--r--actionview/lib/action_view/helpers/asset_tag_helper.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/actionview/lib/action_view/helpers/asset_tag_helper.rb b/actionview/lib/action_view/helpers/asset_tag_helper.rb
index b7fdc16a9d..5c28043f8a 100644
--- a/actionview/lib/action_view/helpers/asset_tag_helper.rb
+++ b/actionview/lib/action_view/helpers/asset_tag_helper.rb
@@ -318,6 +318,7 @@ module ActionView
end
def extract_dimensions(size)
+ size = size.to_s
if size =~ %r{\A\d+x\d+\z}
size.split('x')
elsif size =~ %r{\A\d+\z}