Converting a regular Youtube 'link' into an embedded video

前端 未结 10 1847
别那么骄傲
别那么骄傲 2021-01-30 02:25

My goal: I am trying to allow users to embed a link to a Youtube video in my site, while giving me control over the player\'s settings.

I would like to do this by only a

10条回答
  •  执念已碎
    2021-01-30 03:24

    I used the highest rated answer about with the function youtube_embed but when I implemented in my view I was seeing the iframe code appear in my page, but no video. I added raw before the function call and all is good with the page now.

    Inside my view.html.erb

    <%= raw(youtube_embed(@experiment.researchsection.videolink)) %>

提交回复
热议问题