1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #15312 from JuanitoFatas/action_view/asset_path

Convert source to string if it is present.
This commit is contained in:
Yves Senn 2014-05-25 17:16:05 +02:00
commit 21ec7fefea

View file

@ -118,8 +118,8 @@ module ActionView
# asset_path "application", type: :stylesheet # => /stylesheets/application.css
# asset_path "http://www.example.com/js/xmlhr.js" # => http://www.example.com/js/xmlhr.js
def asset_path(source, options = {})
source = source.to_s
return "" unless source.present?
source = source.to_s
return source if source =~ URI_REGEXP
tail, source = source[/([\?#].+)$/], source.sub(/([\?#].+)$/, '')