Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I just got it working myself. Are you using the <code>jquery-datatables-rails</code> gem? If not, you should! Put this line in your gemfile:</p> <pre><code>gem 'jquery-datatables-rails', github: 'rweng/jquery-datatables-rails' </code></pre> <p>and run: </p> <blockquote> <p>bundle install</p> </blockquote> <p>NOTE: Don't put it in your assets group or it will not work when deploying to heroku (since the assets group is not used in production).</p> <p>Also, make sure to put this line in your application.rb:</p> <pre><code>config.assets.initialize_on_precompile = false </code></pre> <p>Add these to your application.js</p> <pre><code>//= require dataTables/jquery.dataTables //= require dataTables/jquery.dataTables.bootstrap </code></pre> <p>Add this to your application.css:</p> <pre><code> *= require dataTables/jquery.dataTables.bootstrap </code></pre> <p>And add this to your js.coffee file for your controller you are using datatables in:</p> <p>If you are using fluid containers:</p> <pre><code>#// For fluid containers $('#dashboard').dataTable({ "sDom": "&lt;'row-fluid'&lt;'span6'l&gt;&lt;'span6'f&gt;r&gt;t&lt;'row-fluid'&lt;'span6'i&gt;&lt;'span6'p&gt;&gt;", "sPaginationType": "bootstrap" }); </code></pre> <p>If you are using fixed width containers: </p> <pre><code>#// For fixed width containers $('.datatable').dataTable({ "sDom": "&lt;'row'&lt;'span6'l&gt;&lt;'span6'f&gt;r&gt;t&lt;'row'&lt;'span6'i&gt;&lt;'span6'p&gt;&gt;", "sPaginationType": "bootstrap" }); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload