dan
dan

Reputation: 3

Embedded Youtube video in a Ruby on Rails page

New to programming. I am trying to embed a YouTube video from a link stored in a database named "Promoter" into a ruby-on-rails page (.erb). I've looked at the source the code turns out, but the object video player does not appear (on heroku here: http://blazing-mountain-574.heroku.com/).

The code in the home.html.erb file:

 <h1>Pages#home</h1>
<p>Find me in app/views/pages/home.html.erb</p>
<object width="640" height="385">
<param name="movie" value="<%= sanitize Promoter.first.link %>">
</param><param name="allowFullScreen" value="true"></param
><param name="allowscriptaccess" value="always"></param>
<embed src="<%= sanitize Promoter.first.link %>" 
type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true"    width="640" height="385"></embed></object>

Is there something real simple that I'm missing?

Upvotes: 0

Views: 5254

Answers (1)

Nikita Rybak
Nikita Rybak

Reputation: 68006

Have you tried to actually look what links in youtube embeddable code look like? Go to the video you're trying to embed and push 'embed' button.
You have

http://www.youtube.com/watch?v=DKRlWLDWhGI

and in the code from youtube we see

http://www.youtube.com/v/DKRlWLDWhGI?fs=1&amp;hl=en_US

Upvotes: 2

Related Questions