Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery Datatables work Locally but not on Heroku
    primarykey
    data
    text
    <p>I am working on implementing jquery-datatables-rails gem into my application. I can initiate it successfully on my local host, but when I push to Heroku, my table that is supposed to convert to a DataTable does and shows nothing.</p> <p>I have followed many tutorials but for some reason can not get it to initiate. Here is my setup:</p> <p><strong>Application.js</strong></p> <pre><code>//= require jquery //= require jquery-ui //= require jquery_ujs //= require bootstrap-dropdown //= require bootstrap //= require dataTables/jquery.dataTables //= require dataTables/jquery.dataTables.bootstrap //= require_tree . </code></pre> <p><strong>Application.css</strong></p> <pre><code> *= require_self *= require dataTables/jquery.dataTables *= require dataTables/jquery.dataTables.bootstrap *= require_tree . </code></pre> <p><strong>Locations.js.coffee</strong></p> <pre><code>jQuery -&gt; $('#locations').dataTable sPaginationType: "bootstrap" 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;" </code></pre> <p>And my <strong>application.rb</strong> does contain: config.assets.initialize_on_precompile = false</p> <p><strong>After More Testing</strong></p> <p>After much testing, it seems like Data Tables is not taking a liking to some of my fields. It is very strange. For example:</p> <pre><code>&lt;td&gt;&lt;%= network.name %&gt;&lt;/td&gt; &lt;td&gt;&lt;%= network.user.try(:name) %&gt;&lt;/td&gt; &lt;td&gt;&lt;%= network.phone_number %&gt;&lt;/td&gt; &lt;td&gt;&lt;%= network.user.try(:email) %&gt;&lt;/td&gt; </code></pre> <p>If I remove the :email and :user field, DT works. I thought maybe it was because the way it was formatted so I even tried to convert it to the same layout as &lt;%= network.name %> and still does not work. The second I remove it, it works again.</p> <p>Very Strange</p>
    singulars
    1. This table or related slice is empty.
    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. This table or related slice is empty.
    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