instance method
audio_path
Ruby on Rails 5.2.8.1
Since v4.0.13Signature
audio_path(source, options = {})
Computes the path to an audio asset in the public audios directory. Full paths from the document root will be passed through. Used internally by audio_tag to build the audio path.
audio_path("horse") # => /audios/horse audio_path("horse.wav") # => /audios/horse.wav audio_path("sounds/horse.wav") # => /audios/sounds/horse.wav audio_path("/sounds/horse.wav") # => /sounds/horse.wav audio_path("http://www.example.com/sounds/horse.wav") # => http://www.example.com/sounds/horse.wav
Parameters
-
sourcereq -
optionsopt = {}
Source
# File actionview/lib/action_view/helpers/asset_url_helper.rb, line 426
def audio_path(source, options = {})
path_to_asset(source, { type: :audio }.merge!(options))
end
Defined in actionview/lib/action_view/helpers/asset_url_helper.rb line 426
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionView::Helpers::AssetUrlHelper