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:
commit
21ec7fefea
1 changed files with 1 additions and 1 deletions
|
@ -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(/([\?#].+)$/, '')
|
||||
|
|
Loading…
Reference in a new issue