Embed URL from variable in HTML file in Rails application
Posted
by TejasM
on Stack Overflow
See other posts from Stack Overflow
or by TejasM
Published on 2010-05-17T06:55:32Z
Indexed on
2010/05/17
7:00 UTC
Read the original article
Hit count: 242
hi, 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. Please help
© Stack Overflow or respective owner