ActionView::Helpers::AssetUrlHelper
asset_path
API docs (Rails 8.1.4.1) ↗Alias: path_to_asset
def asset_path(source, options = {})
Description
Returns the path to an asset as a string. Asset tag helpers such as image_tag use it to build values like src.
image_path, javascript_path, stylesheet_path, audio_path, video_path and font_path call this helper with their kind as the :type option (image_path("logo.png") is the same as asset_path("logo.png", type: :image)).ERB
Changes from the previous output: Added Removed Changed
HTML
Preview
Form submission
Form data
| name | value |
|---|
Request body
Content-Type:
params