title: javascript_include_tag "directory/file" results in incorrect path for //= require assets
body: <p>I want to use <code>//= require &lt;lib&gt;</code> from a different file than <code>/app/assets/javascripts/application.js</code>. This results in a asset compile error but the problem is that the path is incorrect. I made a simplified project that show the problem available at <a href="https://github.com/rusanu/test-ember" rel="nofollow">https://github.com/rusanu/test-ember</a>. </p>
  
  <p>In the <a href="https://github.com/rusanu/test-ember/blob/master/app/views/layouts/application.html.erb" rel="nofollow">layout</a>:</p>
  
  <pre><code>&lt;head&gt;
    &lt;title&gt;TestEmber&lt;/title&gt;
    &lt;%= stylesheet_link_tag    "application", :media =&gt; "all" %&gt;
    &lt;%= javascript_include_tag "application" %&gt;
    &lt;%= yield :head %&gt;
    &lt;%= csrf_meta_tags %&gt;
  &lt;/head&gt;
  </code></pre>
  
  <p>In the <a href="https://github.com/rusanu/test-ember/blob/master/app/views/dashboard/show.html.erb" rel="nofollow">view</a>:</p>
  
  <pre><code>&lt;%= content_for :head do %&gt;
  &lt;%= javascript_include_tag "dashboard/dashboard", :cache =&gt; 'dashboard' %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>and in my <a href="https://github.com/rusanu/test-ember/blob/master/app/assets/javascripts/dashboard/dashboard.js" rel="nofollow">dashboard/dashboard.js</a>:</p>
  
  <pre><code>//= require handlebars
  //= require ember
  //= require ember-data
  //= require_self
  </code></pre>
  
  <p>This results in error:</p>
  
  <pre><code>Showing /home/rremus/test-ember/app/views/dashboard/show.html.erb where line #2 raised:
  
  No such file or directory - Asset file not found at '/home/rremus/test-ember/public/home/rremus/.rvm/gems/ruby-2.0.0-p0/gems/handlebars-source-1.0.0.rc4/dist/handlebars.js'
  Extracted source (around line #2):
  
  1: &lt;%= content_for :head do %&gt;
  2: &lt;%= javascript_include_tag "dashboard", :cache =&gt; 'dashboard' %&gt;
  3: &lt;% end %&gt;
  4: 
  5: &lt;h1&gt;Dashboard#show&lt;/h1&gt;
  </code></pre>
  
  <p>Notice how the asset path consist of the project public directory (<code>/home/rremus/test-ember/public</code>) and then correct asset path (<code>/home/rremus/.rvm/...</code>) is appended, resulting into an incorrect path.</p>