title: Rails + Javascript + Uncaught TypeError: Object #<Object> has no method
body: <p>I'm using a template that I bought and I'm having this issue:</p>
  
  <pre><code>Uncaught TypeError: Object #&lt;Object&gt; has no method 'peity' in unicorn.dashboard.js:11
  </code></pre>
  
  <p>and this is line 11:</p>
  
  <pre><code>unicorn.peity();
  </code></pre>
  
  <p>On my manifest file I got this:</p>
  
  <pre><code>//= require admins/cms/excanvas.min
  //= require admins/cms/jquery.min
  //= require admins/cms/jquery.ui.custom
  //= require admins/cms/jquery.uniform
  //= require admins/cms/jquery.flot.min
  //= require admins/cms/jquery.flot.resize.min
  //= require admins/cms/jquery.dataTables.min
  //= require admins/cms/jquery.gritter.min
  //= require admins/cms/jquery.validate
  
  //= require admins/cms/jquery.peity
  
  //= require admins/cms/jquery.wizard
  //= require admins/cms/select2.min
  //= require admins/cms/fullcalendar.min
  //= require admins/cms/bootstrap.min
  //= require admins/cms/bootstrap-colorpicker
  //= require admins/cms/bootstrap-datepicker
  //= require admins/cms/unicorn
  
  //= require admins/cms/unicorn.dashboard
  
  //= require admins/cms/unicorn.form_common
  //= require admins/cms/unicorn.form_validation
  //= require admins/cms/unicorn.wizard
  //= require admins/cms/unicorn.interface
  //= require admins/cms/unicorn.tables
  //= require admins/cms/unicorn.charts
  //= require admins/cms/unicorn.calendar
  </code></pre>
  
  <p>This is how the scripts are loaded in the static index.html that came with the template:</p>
  
  <pre><code>&lt;script src="js/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="js/jquery.ui.custom.js"&gt;&lt;/script&gt;
  &lt;script src="js/bootstrap.min.js"&gt;&lt;/script&gt;
  &lt;script src="js/bootstrap-colorpicker.js"&gt;&lt;/script&gt;
  &lt;script src="js/bootstrap-datepicker.js"&gt;&lt;/script&gt;
  &lt;script src="js/jquery.uniform.js"&gt;&lt;/script&gt;
  &lt;script src="js/select2.min.js"&gt;&lt;/script&gt;
  &lt;script src="js/unicorn.js"&gt;&lt;/script&gt;
  &lt;script src="js/unicorn.form_common.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>And this is how my dashboard index scripts are loaded:</p>
  
  <pre><code>&lt;script src="/assets/admins/cms/excanvas.min.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/admins/cms/jquery.min.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/admins/cms/jquery.ui.custom.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/admins/cms/jquery.uniform.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/admins/cms/jquery.flot.min.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/admins/cms/jquery.flot.resize.min.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/admins/cms/jquery.dataTables.min.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/admins/cms/jquery.gritter.min.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/admins/cms/jquery.validate.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/admins/cms/jquery.peity.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/admins/cms/jquery.wizard.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/admins/cms/select2.min.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/admins/cms/fullcalendar.min.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/admins/cms/bootstrap.min.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/admins/cms/bootstrap-colorpicker.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/admins/cms/bootstrap-datepicker.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/admins/cms/unicorn.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/admins/cms/unicorn.dashboard.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/admins/cms/unicorn.form_common.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/admins/cms/unicorn.form_validation.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/admins/cms/unicorn.wizard.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/admins/cms/unicorn.interface.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/admins/cms/unicorn.tables.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/admins/cms/unicorn.charts.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/admins/cms/unicorn.calendar.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>The weird thing is that unicorn.dashboard is getting loaded after jquery.peity. Another extrange thing is that when I open the index.html that came with the template it doesn't get this error at all. I'm not sure what the problem could be. I been trying for hours to figure this out but I had no luck at all.</p>
  
  <p>It would be so helpful if someone could help me out with this. Thanks in advance.</p>