title: How do run a local HTML file in an iframe within my rails 4 app
body: <p>Rails 4.2, Ruby 2.1.2</p>
  
  <p>I have an html file that right now just lives in the public folder of my app. I am trying to figure out how to serve the content of that file within an iframe from the app. The html file is an articulate storyline (but I don't think that really matters). I am sure that the file needs to "speak" with the browser to make some determinations on how to render content i.e. flash, HTML5 etc... the file looks like this:</p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;html style="height: 100%;"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html;charset=utf-8" &gt;
  &lt;!-- Created using Articulate Storyline 1.2 - http://www.articulate.com  --&gt; 
  &lt;!-- version: 1.2.1212.1412 --&gt; 
  &lt;!-- saved from url=(0014)about:internet --&gt;
  
  &lt;title&gt;BasicSearch1&lt;/title&gt;
  &lt;style&gt;
  body { margin: 0px; } 
  object {outline: none;}
  &lt;/style&gt;
  &lt;script&gt;
  var g_bHtml5Supported = true;
  &lt;/script&gt;
  &lt;!--[if lte IE 9]&gt;&lt;script&gt;g_bHtml5Supported = false;&lt;/script&gt;&lt;![endif]--&gt;
  
  &lt;script type="text/javascript"&gt;
  
  // Detect min flash version
  var g_bMinFlash = false;
  
  if (navigator.plugins["Shockwave Flash"])
  {
  var arrDescription = navigator.plugins["Shockwave Flash"].description.split(" ");
  var nVersion = Number(arrDescription[arrDescription.length - 2]);
  
  g_bMinFlash = (nVersion &gt;= 10) || isNaN(nVersion);
  }
  </code></pre>
  
  <p>... etc</p>
  
  <p>Understanding that this is JavaScript . . .</p>
  
  <p>I have tried the following things with some limited success:</p>
  
  <p>Idea 1)</p>
  
  <p>Within my controller . . .</p>
  
  <pre><code>@file = File.join(Rails.root, "public/asl_files/BasicSearch1/story.html")
  </code></pre>
  
  <p>Within the view . . . </p>
  
  <pre><code>&lt;iframe src="&lt;% @file %&gt;"&gt;&lt;/iframe&gt;
  </code></pre>
  
  <p>result: this one renders the iframe fine, but its just blank white inside.</p>
  
  <p>idea 2)</p>
  
  <p>Within my controller . . .</p>
  
  <pre><code>@file = show_asl
  
    def show_asl
     asl_filename = File.join(Rails.root, "public/asl_files/BasicSearch1/story.html")
     send_file(asl_filename, :filename =&gt; "story.html", :type =&gt; "text/html; charset=utf-8", disposition: "inline")
    end
  </code></pre>
  
  <p>Within the view . . . </p>
  
  <pre><code>&lt;iframe src="&lt;% @file %&gt;"&gt;&lt;/iframe&gt;
  </code></pre>
  
  <p>result: this one doesn't look like it renders a defined iframe, instead turns the whole page grey. </p>