title: Datatables Not Activating in Rails - proper asset pipeline setup
body: <p>I was following the railscasts for building a datatable at: <a href="http://railscasts.com/episodes/340-datatables?autoplay=true" rel="nofollow noreferrer">http://railscasts.com/episodes/340-datatables?autoplay=true</a></p>
  
  <p>Following all steps, the table still renders the same as before, static html:</p>
  
  <p><img src="https://i.stack.imgur.com/CkW4b.png" alt="enter image description here"></p>
  
  <p>I am using bootstrap all with many other gems previously but datatables would add allot to the usability of the application.</p>
  
  <p>I have posted the code that I am presently using, </p>
  
  <p>What may be wrong? Is there a way to debug javascript in a rails app instead of doing things blindly?</p>
  
  <p>manage.html.erb (Note: in the Locations view folder):</p>
  
  <pre><code>&lt;% if @restaurant.locations.any? %&gt;
      &lt;h1&gt;Manage &lt;%= @restaurant.name.pluralize %&gt; Restaurant Locations&lt;/h1&gt;
  
      &lt;table id="restaurantLocations"&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Store Number&lt;/th&gt;
              &lt;th&gt;Address&lt;/th&gt;
              &lt;th&gt;City&lt;/th&gt;
              &lt;th&gt;State&lt;/th&gt;
              &lt;th&gt;Nearest Bidding City&lt;/th&gt;
              &lt;th&gt;Zip Code&lt;/th&gt;
              &lt;th&gt;Sit Down?&lt;/th&gt;
              &lt;th&gt;Drive Through?&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;%# current_user.locations.each do |branch| %&gt;
      &lt;tbody&gt;
        &lt;% @restaurant.locations.each do |branch| %&gt;
              &lt;tr&gt;
                  &lt;td&gt;&lt;%= branch.store_number %&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;%= branch.address %&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;%= branch.city_name %&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;%= branch.state.upcase %&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;%= Metro.where(id: branch.city_id).pluck(:city).first %&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;%= branch.zip %&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;%= branch.sit_down %&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;%= branch.drive_through %&gt;&lt;/td&gt;
              &lt;/tr&gt;
          &lt;% end %&gt;
      &lt;/tbody&gt;
      &lt;/table&gt;
  &lt;% else %&gt;
  
      &lt;h1&gt;Upload &lt;%= @restaurant.name.pluralize %&gt; Restaurant Locations&lt;/h1&gt;
      &lt;p&gt;Simply format your CSV file as the sample:(INSERT EXAMPLE) and upload&lt;/p&gt;
  &lt;% end %&gt;
  
  &lt;h2&gt;Import Restaurants&lt;/h2&gt;
  
  &lt;%= form_tag import_locations_path(id: @restaurant.id), multipart: true do %&gt;
      &lt;%= file_field_tag :file %&gt;
      &lt;%= submit_tag "Import" %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>application.js:</p>
  
  <pre><code>//= require jquery
  //= require jquery_ujs
  //= require chosen-jquery
  //= require bootstrap
  //= require dataTables/jquery.dataTables
  //= require dataTables/bootstrap/2/jquery.dataTables.bootstrap
  //= require turbolinks
  //= require bootstrap-datepicker
  //= require raphael
  //= require morris
  //= require underscore
  //= require gmaps/google
  //= require_tree .
  </code></pre>
  
  <p>applcation.css:</p>
  
  <pre><code>*
   *= require_self
   *= require chosen
   *= require bootstrap-datepicker
   *= require dataTables/jquery.dataTables
   *= require dataTables/bootstrap/2/jquery.dataTables.bootstrap
   *= require_tree .
   */
  </code></pre>
  
  <p>locations.js.coffee:</p>
  
  <pre><code>jQuery -&gt;
      $("#restaurantLocations").dataTable();
  </code></pre>
  
  <p>gemfile:</p>
  
  <pre><code># DataTables
  gem 'jquery-datatables-rails', github: 'rweng/jquery-datatables-rails'
  </code></pre>