Reputation: 6244
I am using the no configuration option and have taken the following steps:
put css call in the head section of my layout file
<%= stylesheet_link_tag "demo_table", :media => "all" %>
put the initialization script in the head section of my layout file:
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$('#example').dataTable();
} );
</script >
first line of my table layout is:
<table width="100%" style="border-collapse:collapse; " id="example">
I restarted my server. Nothing happens. What am i missing?
Upvotes: 0
Views: 1397
Reputation: 12870
The zero config relies on having a properly formatted table, which your example isn't showing. It must also have <thead>
and <tbody>
elements to render properly. Ensure that's properly setup first.
Second, open the page in Chrome or Firefox, view source. Click on the links to the Datatables.js and Datatables.css files as well as Jquery.js (or whatever each of these files is named) Do they open? If not, there's your problem.
Javascript is essentially platform independent. Sure, you get information TO the script in different manners in Rails, PHP, .net, etc, but there's no reason that this doesn't work in any of the major scripting language.
Upvotes: 2
Reputation: 7303
I have been using the RailsDatatables plugin in my rails apps without any problem. Maybe give that a try?
Upvotes: 1