method

asset_url

Importance_1
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: 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
Show source
Register or log in to add new notes.