title: Rails Asset-pipeline policy
body: <p>quick example,</p>
  
  <p>make a new rails project, and if we look in to <code>app/assets/javascripts/application.js</code></p>
  
  <p>it says,</p>
  
  <pre><code>//= require jquery
  //= require jquery_ujs
  //= require turbolinks
  //= require_tree .
  </code></pre>
  
  <p>in default.</p>
  
  <p>I added <code>foo.js, bar.js</code> in <code>app/assets/javascripts/</code></p>
  
  <p>and if i run the app, this asset-pipeline </p>
  
  <p>loads <code>foo.js, bar.js</code> in every-pages <code>even i don't need to use in most of the pages.</code></p>
  
  <p>Is this a right structure?</p>
  
  <p>What about</p>
  
  <p>change to <code>require_self</code></p>
  
  <p>and use <code>javascript_include_tag</code> and load the js files manually when i need?</p>
  
  <p>Isn't this a better way?</p>
  
  <p>Why Rails asset pipeline default policy is always loading every js files even i dont need?</p>