diff options
author | Yves Senn <yves.senn@gmail.com> | 2015-06-29 10:48:47 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2015-06-29 10:52:00 +0200 |
commit | d4b0e5f59f599a386d43a7f4d005430e87ae7ec4 (patch) | |
tree | 1b5ea08e90994d3a7dfb3c804afd7b5df33cd0b1 /actionview/lib | |
parent | c90c9b2daa133341ad8ceca2d8010ba7d47c4957 (diff) | |
parent | 42a1b0c7c31400c762e2f8d1aff16338bbe8d63d (diff) | |
download | rails-d4b0e5f59f599a386d43a7f4d005430e87ae7ec4.tar.gz rails-d4b0e5f59f599a386d43a7f4d005430e87ae7ec4.tar.bz2 rails-d4b0e5f59f599a386d43a7f4d005430e87ae7ec4.zip |
Merge pull request #20669 from akolomiychuk/image-path
Passing nil to image_tag
Diffstat (limited to 'actionview/lib')
-rw-r--r-- | actionview/lib/action_view/helpers/asset_url_helper.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/actionview/lib/action_view/helpers/asset_url_helper.rb b/actionview/lib/action_view/helpers/asset_url_helper.rb index ef4a6c98c0..b19dc25025 100644 --- a/actionview/lib/action_view/helpers/asset_url_helper.rb +++ b/actionview/lib/action_view/helpers/asset_url_helper.rb @@ -121,6 +121,8 @@ module ActionView # asset_path "application", type: :stylesheet # => /assets/application.css # asset_path "http://www.example.com/js/xmlhr.js" # => http://www.example.com/js/xmlhr.js def asset_path(source, options = {}) + raise ArgumentError, "nil is not a valid asset source" if source.nil? + source = source.to_s return "" unless source.present? return source if source =~ URI_REGEXP |