title: Rails 4 - DataTable with pagination
body: <p>I am trying to get a sortable html table with pagination working in my rails application. But nothing i do has any effect. </p>
  
  <p>I am using rails 4.2.4 and foundation 6.</p>
  
  <p>I have followed all the steps </p>
  
  <blockquote>
    <p>here: <a href="https://github.com/rweng/jquery-datatables-rails" rel="nofollow">https://github.com/rweng/jquery-datatables-rails</a></p>
    
    <p>here: <a href="https://datatables.net" rel="nofollow">https://datatables.net</a></p>
    
    <p>here: <a href="http://datatables.net/dev/foundation.html" rel="nofollow">http://datatables.net/dev/foundation.html</a></p>
  </blockquote>
  
  <p>Everyone of these makes it seem like the work to get this running is very simple. </p>
  
  <p>I have the following:</p>
  
  <p>Gemfile: </p>
  
  <pre><code>gem 'jquery-datatables-rails', '~&gt; 3.4.0'
  </code></pre>
  
  <p>Application.js:</p>
  
  <pre><code>//= require jquery
  //= require jquery_ujs
  //= require dataTables/jquery.dataTables
  //= require dataTables/jquery.dataTables.foundation
  //= require jquery-ui
  //= require autocomplete-rails
  //= require foundation
  //= require turbolinks
  //= require_tree .
  
  $(function(){ 
      $(document).foundation(); 
  });
  </code></pre>
  
  <p>Inside my view i have:</p>
  
  <pre><code>&lt;script&gt;
    $(document).ready(function() {
      $('#jobsTable').dataTable();
    } );
  &lt;/script&gt;
  
  &lt;link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/zf/jq-2.2.3/dt-1.10.12/datatables.min.css"/&gt;
  
  &lt;script type="text/javascript" src="https://cdn.datatables.net/v/zf/jq-2.2.3/dt-1.10.12/datatables.min.js"&gt;&lt;/script&gt;
  
  &lt;table id="jobsTable"&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;Job ID&lt;/th&gt;
        &lt;th&gt;Created On&lt;/th&gt;
        &lt;th&gt;User&lt;/th&gt;
        &lt;th&gt;Company&lt;/th&gt;
        &lt;th&gt;Subcontractor&lt;/th&gt;
        &lt;th&gt;Jobsite&lt;/th&gt;
        &lt;th colspan="2"&gt;&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
  
    &lt;tbody&gt;
      &lt;% @jobs.each do |job| %&gt;
        &lt;tr&gt;
          &lt;td&gt;&lt;%= job.id %&gt; &lt;/td&gt;
          &lt;td&gt;&lt;%= job.date.strftime("%I:%M %p, %b %d %Y") %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= job.user.username %&gt;&lt;/td&gt;
          &lt;% if job.company %&gt;
            &lt;td&gt;&lt;%= job.company.name %&gt;&lt;/td&gt;
          &lt;% else %&gt;
            &lt;td&gt; N/A &lt;/td&gt;
          &lt;% end %&gt;
          &lt;% if job.subcontractor %&gt;
            &lt;td&gt;&lt;%= job.subcontractor.name %&gt;&lt;/td&gt;
          &lt;% else %&gt;
            &lt;td&gt; N/A &lt;/td&gt;
          &lt;% end %&gt;
          &lt;% if job.jobsite %&gt;
            &lt;td&gt;&lt;%= job.jobsite.name %&gt;&lt;/td&gt;
          &lt;% else %&gt;
            &lt;td&gt; N/A &lt;/td&gt;
          &lt;% end %&gt;
          &lt;td&gt;&lt;%= link_to 'Show', job %&gt;&lt;/td&gt;
          &lt;!-- if current_user.admin %&gt; --&gt;
            &lt;!-- &lt;td style="background: lightgray;"&gt; link_to 'Destroy', job, method: :delete, data: { confirm: 'Are you sure?' } %&gt;&lt;/td&gt; --&gt;
          &lt;!-- end %&gt; --&gt;
        &lt;/tr&gt;
      &lt;% end %&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>But the table does not change no matter what. 
  This is the table currently:</p>
  
  <p><a href="https://i.stack.imgur.com/SNuz9.png" rel="nofollow"><img src="https://i.stack.imgur.com/SNuz9.png" alt="enter image description here"></a></p>
  
  <p>And according to all the links i listed, with everything I have done, it should magically change to look like this, with the buttons and pagination:</p>
  
  <p><a href="https://i.stack.imgur.com/33GCA.png" rel="nofollow"><img src="https://i.stack.imgur.com/33GCA.png" alt="enter image description here"></a></p>
  
  <p>Can anyone please help and tell me what I am doing wrong here? I have been searching for hours looking at examples and I have not been able to find out why this is not working. </p>
  
  <p><strong>Update:</strong></p>
  
  <p>I double checked my steps with the installation directions direct from their website <a href="https://datatables.net/manual/installation" rel="nofollow">https://datatables.net/manual/installation</a> and I still cannot see anything that I am doing wrong. </p>
  
  <p>Any help is greatly appreciated. </p>