title: how to remove &quot in js.erb to render javascript rails
body: <p>I want to append a javascript code to the body through file.js.erb. This is what i have written:</p>
  
  <pre><code>$("body").append("&lt;script type='text/javascript'&gt; method_1({'&lt;%= current_user.selections.pluck(:name).each do |t| raw t end %&gt;'});&lt;/script&gt;");
  </code></pre>
  
  <p>But i always gives me an array with &amp; quot; appended in the javascript code. I also tried using raw/html_safe. but it seems to throw no effect </p>
  
  <p>I have tried other SO links, but it does not seem to help. I am using rails 3.</p>