title: Embedding erb code in javascript for asset pipeline
body: <p>In my rails 3.1.3 app, I'd like to insert some ERB code in my javascript file but it's not being parsed for some reason:</p>
  
  <pre><code># app/assets/javascripts/application.js
  //= require_tree ./shared
  
  # app/assets/javascripts/shared/shared.js.erb
  MM.loading = '&lt;img src="&lt;%= asset_path("icons/ajax-loader.gif") &gt;"&gt;';
  </code></pre>
  
  <p>Gets rendered like this in <code>/application.js</code>:</p>
  
  <pre><code>MM.loading = '&lt;img src=" asset_path("icons/ajax-loader.gif") &gt;"&gt;';
  </code></pre>
  
  <p>I can't see any extra steps in the rails guides - is there something I'm missing? Btw I'm using haml for the view files, and also tried the above with <code>.js.haml</code>, enclosing in <code>#{...}</code>.</p>