Repository is archived
No commit activity in last 3 years
No release in over 3 years
DataTables is a table enhancing plug-in for the jQuery Javascript library, adding sorting, paging and filtering abilities to plain HTML tables with minimal effort.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.12
~> 10.0
 Project Readme

datatablesassets-rails Gem Version

The datatablesassets-rails gem packages the jQuery DataTables assets for easy inclusion in an Rails application using assets pipeline.

DataTables version used in the project: 1.10.12

Installation

To use this gem you need jQuery in your application javascript.

Add this line to your application's Gemfile:

gem 'datatablesassets-rails'

And then execute:

$ bundle

Or install it yourself as:

$ gem install datatablesassets-rails

Usage

JavaScript

Include the javascript part:

For Coffeescript

#= require datatables/jquery.dataTables

For JavaScript

//= require datatables/jquery.dataTables

Make sure you add the line after the inclusion of jQuery

Stylesheets

Include the style part:

@import "datatables/jquery.dataTables";

Initialize

Example for Bootsrtap

app/assets/javascript/applicataion.js
//= require jquery
//= require jquery_ujs
//= require bootstrap-sprockets
//= require datatables/jquery.dataTables
//= require datatables/dataTables.bootstrap

$(document).ready(function() {
    $('table').DataTable();
});
app/assets/stylesheets/style.scss
@import "bootstrap-sprockets";
@import "datatables/dataTables.bootstrap";

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

The gem is available as open source under the terms of the MIT License.