Embed URL from variable in HTML file in Rails application
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>
<para开发者_如何学Gom 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.
Probably a mistype but you need to add = both here:
value="<%= @movie.trailer %>"
and here
src="<%= @movie.trailer %>"
精彩评论