module ActionView::Helpers::AssetUrlHelper
def audio_path(source, options = {})
audio_path("/sounds/horse.wav") # => /sounds/horse.wav
audio_path("sounds/horse.wav") # => /audios/sounds/horse.wav
audio_path("horse.wav") # => /audios/horse.wav
audio_path("horse") # => /audios/horse
Used internally by +audio_tag+ to build the audio path.
Full paths from the document root will be passed through.
Computes the path to an audio asset in the public audios directory.
def audio_path(source, options = {}) path_to_asset(source, { type: :audio }.merge!(options)) end