title: Rails with backbone-rails: asset helpers (image_path) in EJS files
body: <p>I have a Rails 3.1 app that uses the <a href="https://github.com/codebrew/backbone-rails" rel="noreferrer">codebrew/backbone-rails</a>. In a .jst.ejs template, I would like to include an image, like so:</p>
  
  <pre><code>&lt;img src="&lt;%= image_path("foo.png") %&gt;"/&gt;
  </code></pre>
  
  <p>But of course the asset helpers are not available in JavaScript.</p>
  
  <p>Chaining ERB (.jst.ejs.erb) does not work, because the EJS syntax conflicts with ERB.</p>
  
  <p>Here is what I know:</p>
  
  <ul>
  <li>The asset helpers are not available in the browser, so I need to run them on the server side.</li>
  <li>I can work around the problem by making the server dump various asset paths into the HTML (through data attributes or <code>&lt;script&gt;</code> and JSON) and reading them back in JS, but this seems rather kludgy.</li>
  </ul>
  
  <p>Is there a way to somehow use the asset helpers in EJS files?</p>