audio_tag

audio_tag(*sources)
Instance Public methods

Returns an HTML audio tag for the source. The source can be full path or file that exists in your public audios directory.

audio_tag("sound")
# => <audio src="/audios/sound" />
audio_tag("sound.wav")
# => <audio src="/audios/sound.wav" />
audio_tag("sound.wav", autoplay: true, controls: true)
# => <audio autoplay="autoplay" controls="controls" src="/audios/sound.wav" />
audio_tag("sound.wav", "sound.mid")
# => <audio><source src="/audios/sound.wav" /><source src="/audios/sound.mid" /></audio>
doc_ruby_on_rails
2015-06-20 00:00:00
Comments
Leave a Comment

Please login to continue.