문제

I want the user to be give me an URL that ends with the .mp3 extension and be played in the show page.

I used scaffolding to create the new page for the User to submit the URL, and in the show page I want this URL to be play the associated media file:

<p>
<strong>Music url:</strong>
<%= @profile_music.music_url %>
</p>

If it was an ordinary HMTL page I would use:

<EMBED SRC= "url.mp3" width="360" height="165" HIDDEN=false AUTOSTART=true loop="false" volume="60">

So I need something like:

<EMBED SRC= @profile_music.music_url width="360" height="165" HIDDEN=false AUTOSTART=true loop="false" volume="60">
도움이 되었습니까?

해결책

Use this:

<EMBED SRC="<%= @profile_music.music_url %>"
    width="360" height="165" HIDDEN=false AUTOSTART=true loop="false" volume="60">

<%= @profile_music.music_url %> will be interpreted by erb with the actual content.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top