method
asset_url
v5.1.7 -
Show latest stable
- Class:
ActionView::Helpers::AssetUrlHelper
asset_url(source, options = {})public
Computes the full URL to an asset in the public directory. This will use asset_path internally, so most of their behaviors will be the same. If :host options is set, it overwrites global config.action_controller.asset_host setting.
All other options provided are forwarded to asset_path call.
asset_url "application.js" # => http://example.com/assets/application.js asset_url "application.js", host: "http://cdn.example.com" # => http://cdn.example.com/assets/application.js