From 2ccd37a7afa71647291de7e3e2b3f4a6bb66747f Mon Sep 17 00:00:00 2001 From: Christian Bruckmayer Date: Mon, 10 Mar 2014 18:40:32 +0100 Subject: [PATCH] Add request.ssl check in proposal view to fix mixed content issue for embedded youtube video close #1 --- app/views/proposal/show.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/proposal/show.html.haml b/app/views/proposal/show.html.haml index f1bd4a28..9e0bc20d 100644 --- a/app/views/proposal/show.html.haml +++ b/app/views/proposal/show.html.haml @@ -31,9 +31,9 @@ .row-fluid .span12.flexvideo -if @event.video_id - %iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=>"http://www.youtube.com/embed/#{@event.video_id}?rel=0"} + %iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=> request.ssl? ? "https://" : "http://" + "www.youtube.com/embed/#{@event.video_id}?rel=0"} -else - %iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=>"http://www.youtube.com/embed/Eiv4e5ZxTmg?rel=0"} + %iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=>request.ssl? ? "https://" : "http://" + "www.youtube.com/embed/Eiv4e5ZxTmg?rel=0"} .row-fluid .span8 %h3