title: Rails specify load order of javascript files?
body: <p>In my application.js file, I have:</p>
  
  <pre><code>//= require jquery
  //= require jquery_ujs
  //= require underscore
  //= require backbone
  //= require_tree .
  //
  //= require .//community_app
  //
  //= require_tree ../templates/
  //= require_tree .//models
  //= require_tree .//collections
  //= require_tree .//views
  //= require_tree .//routers
  </code></pre>
  
  <p>but the generated html doesn't obey this order:</p>
  
  <pre><code>&lt;head&gt;
    &lt;title&gt;CommunityApp&lt;/title&gt;
    &lt;link href="/assets/application.css?body=1" media="all" rel="stylesheet" type="text/css" /&gt;
  &lt;link href="/assets/communities.css?body=1" media="all" rel="stylesheet" type="text/css" /&gt;
  &lt;link href="/assets/home.css?body=1" media="all" rel="stylesheet" type="text/css" /&gt;
    &lt;script src="/assets/jquery.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/jquery_ujs.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/underscore.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/backbone.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/collections/communities.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/community_app.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/home.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/models/community.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/application.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
    &lt;meta content="authenticity_token" name="csrf-param" /&gt;
  &lt;meta content="ktrLMDYSJaU/mmgmzfpxDfMin7OCXga4K5gVIJZHJUI=" name="csrf-token" /&gt;
  &lt;/head&gt;
  &lt;body&gt;
  </code></pre>
  
  <p>Collections is loaded before the model which gives me error on the front-end. How can I make it so it loads in a specific manner the js files?
  thanks</p>