views:

139

answers:

1

I have a doubt which might be silly for experience Rails developers. I am creating an application which is suppose to embed a video player with URL passed to it.

So while displaying i.e in XXX.html.erb file i am writting below code. Now problem is @movie.trailer is my variable in ruby code which has URL value . I want the embedded video to load with URL given by this variable value. Any suggestion how am i suppose to place the value of Ruby variable(@movie.trailer) in part.

<object width="425" height="344">
    <param name="movie" value="<% @movie.trailer %>"> </param>
    <param name="allowFullScreen" value="true"> </param>
    <param name="allowscriptaccess" alue="always"> </param>
    <embed src="<% @movie.trailer %>" type="application/x-shockwave-flash"
        allowscriptaccess="always" allowfullscreen="true"
        width="425" height="344">
    </embed>
</object> 

Note: This code is working perfectly fine if i statically give value of URL.

+1  A: 

Probably a mistype but you need to add = both here:

value="<%= @movie.trailer %>"

and here

src="<%= @movie.trailer %>"
tommasop