My ruby on rails application has datatables; however, they only appear after the user goes to the page and refreshes once. It doesn't appear initially when then they go to the page.
Here is the javascript that's run prior to the page loading (because it's before the html content);
(function() {
jQuery(function() {
return $('#items').dataTable();
});
}).call(this);
However, I thought using this may help, but it didn't:
$(document).ready(function() {
$('#items').dataTable();
});
Any suggestions on how to accomplish this goal easily?