From ab5f119ac62cdbcc3c9d5c4fd36dafd187b038ca Mon Sep 17 00:00:00 2001 From: Mehdi Lahmam Date: Sun, 15 Feb 2015 21:38:27 +0100 Subject: 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 --- actionview/lib/action_view/helpers/asset_tag_helper.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'actionview/lib/action_view/helpers') 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} -- cgit v1.2.3