title: How can I unescape and remove quot; from data served by rails into javascript
body: <p>This question has been asked a few times on stackoverflow but I've yet to find a way how to unescape double quotes from a rails instance variable that I am trying to serve up in order for my highcharts to make use in my respective <code>js.erb</code> file.</p>
  
  <p>Here is the code that I have:</p>
  
  <pre><code>class FooController &lt; ApplicationController
    def foo
      @foo_bar = @foo.map { |f| f.version }
    end
  end
  </code></pre>
  
  <p>The <code>@foo_bar</code> instance variable should return <code>["1.2.3","3.0","4.5"]</code>. Instead I keep getting this <code>[&amp;quot;1.2.3&amp;quot;, &amp;quot;3.0quot;,quot;4.5quot]</code>; and I can't seem to remove this. I've tried using Rail's <code>escape_javascript</code> method but it still doesn't work. I've tried <code>JSON.parse(instance_variable)</code> and that didn't work either. Lastly, I tried to <code>.gsub</code> the quotes and manually replace them with <code>\"</code> and that didn't work either. Why won't the double quotes escape and how can I get this at the root of the problem? I've tried to solve this both server and client side but to no avail. Does anyone have anymore suggestions?</p>