title: Uncaught ReferenceError: JST is not defined in Backbone using Jade templates
body: <p>I've just set up a skeleton Rails 4 app and have added the <code>backbone-on-rails</code> gem with some basic scaffolding.</p>
  
  <p>In the process of trying to get everything set up, I keep running into the following error:</p>
  
  <pre><code>Uncaught ReferenceError: JST is not defined 
  (anonymous function)
  </code></pre>
  
  <p>when trying to call the template index.jst.jade from the backbone view.</p>
  
  <p>I've added one route with an alert just to make sure the scaffolding was wired together, but I can't get past this error to properly render views.</p>
  
  <p>I have included the jade gem, made sure the template path is correct in the js view, and updated the manifest files accordingly.</p>
  
  <p>Do I have to define JST somewhere? What am I doing wrong here?</p>
  
  <p>Thanks</p>
  
  <p>Gem Versions:</p>
  
  <ul>
  <li>jade (0.1.1) </li>
  <li>backbone-on-rails (1.1.1.0) </li>
  <li>underscore-rails (1.7.0)</li>
  <li>Rails 4.1.6 Ruby 2.1.0</li>
  </ul>
  
  <p>Router: </p>
  
  <pre><code>Task.Routers.Tasks = Backbone.Router.extend({
    routes: {
      '': 'index',
    },
  
    index: function() {  
      alert('index router hit');
    },
  });
  </code></pre>
  
  <p>View: </p>
  
  <pre><code>Task.Views.TasksIndex = Backbone.View.extend({
    template: JST['tasks/index'] 
  });
  </code></pre>
  
  <p>Application.js:</p>
  
  <pre><code>//= require jquery
  //= require lodash
  //= require jquery_ujs  
  //= require backbone
  //= require jade/runtime
  
  //= require task
  //= require_tree ../templates
  //= require_tree ./models
  //= require_tree ./collections
  //= require_tree ./views
  //= require_tree ./routers
  //= require_tree .
  </code></pre>
  
  <p>App structure tree:</p>
  
  <pre><code>|____javascripts
  | |____application.js
  | |____collections
  | | |____tasks.js
  | |____models
  | | |____task.js
  | |____routers
  | | |____tasks_router.js
  | |____task.js
  | |____views
  | | |____tasks
  | | | |____tasks_index.js
  |____templates
  | |____tasks
  | | |____index.jst.jade
  </code></pre>