Handling audio assets in Rails 3.2 with audio_* helpers -


i'm trying include audio files asset pipeline in rails 3.2 app , reference them of audio_* helper methods, doesn't work think should work:

  1. i have audio file here:

    app/assets/audios/onturn.wav

  2. i reference in view (haml):

    %audio{ src: audio_path('onturn.wav'), id: 'on-turn-sound' }

which results in development to:

<audio id='on-turn-sound' src='/audios/onturn.wav'></audio> 

and in production to:

<audio id='on-turn-sound' src='/audios/onturn-7728640b5d844c6b676d10f7572b6c8e.wav'></audio> 

however, none of these files exist. lets take @ resulting manifest.yml file:

onturn.wav: onturn-7728640b5d844c6b676d10f7572b6c8e.wav onturn/index.wav: onturn-7728640b5d844c6b676d10f7572b6c8e.wav 

so, only

public/assets/onturn.wav public/assets/onturn-7728640b5d844c6b676d10f7572b6c8e.wav 

exist.

if put file in public/audios manually , not in app/assets/audios, error in production because file not precompiled, audio_path helper can't find it. if put file @ both locations, not found because no compiled version exists in public/audios don't error.

what clue correct handling of audio , video files? css, js , images working fine, audio , video not work correctly.

you can try

audio_tag 'onturn.wav' 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -