[HowTo]- Create Youtube Link in Ruby on Rails(using Slim)

In your view where you want to show youtube link

ex: app/views/products/show.html.slim

- if @product.youtube_url.present?
  = video_iframe @product.youtube_url

Create a helper

ex: I created in application_helper.rb

def video_iframeideo_iframe(src)
  content_tag("iframe","", {:width => 'XXX', :height =XXX> 'YYY', :src =>"#{src}"} )
end

That’s it ~

Good Luck

Comments

Comments

Google Analytics Alternative