All Projects → mkhairi → jquery-datatables

mkhairi / jquery-datatables

Licence: other
Jquery datatables ruby gems for assets pipeline

Programming Languages

ruby
36898 projects - #4 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to jquery-datatables

material-sass
A rubygem of Material Design for Bootstrap 4
Stars: ✭ 55 (-24.66%)
Mutual labels:  rubygems, rubygem, rubyonrails
Materialize Sass
Materializecss rubygem for Rails Asset Pipeline / Sprockets
Stars: ✭ 785 (+975.34%)
Mutual labels:  rubygems, rubygem, gem
Tabler Rubygem
Rubygem for https://tabler.github.io
Stars: ✭ 77 (+5.48%)
Mutual labels:  rubygems, gem
Karafka
Framework for Apache Kafka based Ruby and Rails applications development.
Stars: ✭ 1,223 (+1575.34%)
Mutual labels:  rubygems, rubygem
The-Ruby-Workshop
A New, Interactive Approach to Learning Ruby
Stars: ✭ 26 (-64.38%)
Mutual labels:  rubygems, rubyonrails
Dry Logic
Predicate logic with rule composition
Stars: ✭ 118 (+61.64%)
Mutual labels:  rubygem, gem
Api Fuzzer
API Fuzzer which allows to fuzz request attributes using common pentesting techniques and lists vulnerabilities
Stars: ✭ 238 (+226.03%)
Mutual labels:  rubygem, gem
Instagram Crawler
Crawl instagram photos, posts and videos for download.
Stars: ✭ 178 (+143.84%)
Mutual labels:  rubygems, gem
Green Button Data
Fast Ruby parser and API client for Green Button data
Stars: ✭ 18 (-75.34%)
Mutual labels:  rubygem, gem
harvesting
Ruby wrapper for the Harvest API v2
Stars: ✭ 24 (-67.12%)
Mutual labels:  rubygems, gem
sinator
Sinatra application generator
Stars: ✭ 19 (-73.97%)
Mutual labels:  rubygems, gem
Graphql devise
GraphQL interface on top devise_token_auth
Stars: ✭ 100 (+36.99%)
Mutual labels:  rubygem, gem
Tty Exit
Terminal exit codes.
Stars: ✭ 101 (+38.36%)
Mutual labels:  rubygem, gem
modular routes
Dedicated controllers for each of your Rails route actions.
Stars: ✭ 45 (-38.36%)
Mutual labels:  rubygem, gem
Dry Validation
Validation library with type-safe schemas and rules
Stars: ✭ 1,087 (+1389.04%)
Mutual labels:  rubygem, gem
Waterdrop
WaterDrop is a standalone Karafka component library for generating Kafka messages
Stars: ✭ 136 (+86.3%)
Mutual labels:  rubygems, rubygem
nlp-pure
Natural language processing algorithms implemented in pure Ruby with minimal dependencies
Stars: ✭ 19 (-73.97%)
Mutual labels:  rubygem, gem
Dry Monads
Useful, common monads in idiomatic Ruby
Stars: ✭ 453 (+520.55%)
Mutual labels:  rubygem, gem
fcmpush
Firebase Cloud Messaging API wrapper for Ruby, suppot HTTP v1 API including access_token auto refresh feature.
Stars: ✭ 44 (-39.73%)
Mutual labels:  rubygems, gem
bootswatch-sass
bootswatch ruby gems for assets pipeline
Stars: ✭ 12 (-83.56%)
Mutual labels:  rubygem, rubyonrails

jquery-datatables Gem Version

Jquery datatables assets pipeline :: sprockets

Include jQuery DataTables in your asset pipeline with ease using jquery-datatables gem.

Gem Installation

Requirements

Rails 6.0+

Since Webpacker the default JavaScript compiler for Rails 6. you can install via yarn.

see this official pages for details.

However, if your app still using javascript with sprockets, this gem is still good to go. How to use sprocket assets pipeline instead of webpacker

Rails 5.1+

The Rails JavaScript helpers has been rewritten in a new gem called rails-ujs and they use vanilla JavaScript, so jQuery is not a dependency of Rails anymore.

Since Jquery datatables relies on jQuery, you can install it with bin/yarn add jquery or via gem 'jquery-rails' and add //= require jquery to application.js.

NOTE: Ensure that the sass-rails gem is presented in your Gemfile.

Add this line to your application's Gemfile:

gem 'jquery-datatables'

And then execute:

$ bundle install

Install generator

command

rails g jquery:datatables:install 

or if you using css framework

rails g jquery:datatables:install bootstrap4

this generator will:

    1. append //= require datatables add app/assets/javascripts/application.js
    1. append *= require datatables add app/assets/stylesheets/application.css
    1. create datatable.js in app/assets/javascripts/ with default init script.
    1. create datatable.scss in app/assets/stylesheets/
    1. create scaffold index template in lib/template

available styling

  • bootstrap
  • bootstrap4
  • foundation
  • jqueryui
  • sematicui
  • material (Tech. preview)
  • uikit (Tech. preview)

Manual install

JavaScripts

Include the JavaScript in your app/assets/javascripts/application.js:

//= require jquery
//= require datatables

create new file app/assets/javascripts/datatables.js

//Core component
//= require datatables/jquery.dataTables
//Bootstrap4 theme
//= require datatables/dataTables.bootstrap4

//Optional Datatables extensions
//= require datatables/extensions/Responsive/dataTables.responsive
//= require datatables/extensions/Responsive/responsive.bootstrap4
//= require datatables/extensions/Buttons/dataTables.buttons
//= require datatables/extensions/Buttons/buttons.html5
//= require datatables/extensions/Buttons/buttons.print
//= require datatables/extensions/Buttons/buttons.bootstrap4

*** you may refer other extensions in this directory: click me

Stylesheets

Include the stylesheet in your app/assets/stylesheets/application.css:

*= require datatables

or if you using scss

Include the stylesheet in your app/assets/stylesheets/application.scss:

@import 'datatables';

Create new file app/assets/stylesheets/datatables.scss
** default theme

@import 'datatables/jquery.dataTables';
@import 'datatables/extensions/Responsive/responsive.dataTables';
@import 'datatables/extensions/Buttons/buttons.dataTables';

** if using boostrap4 theme

@import 'datatables/dataTables.bootstrap4';
@import 'datatables/extensions/Responsive/responsive.bootstrap4';
@import 'datatables/extensions/Buttons/buttons.bootstrap4';

*** you may refer other extensions in this directory: click me

Basic Initialization

Where needed in your JavaScripts, initialize your DataTables:

$(document).ready(function() {
  $("#dttb").dataTable();
});

And you will of course, need to have a html table (with a theader and tbody) with the id set to dttb. Here is an example:

    <table id="dttb" class="table table-hover">
      <thead>
        <tr>
          <th> Panel No</th>          
        </tr>
      </thead>
      <tbody>
        <% @panels.each do |panel| %>
          <tr>
            <td><%= link_to panel.no, panel %></td>
          </tr>
        <% end %>
      </tbody>
    </table>

Server Side processing

Recommended use this gem

 gem 'ajax-datatables-rails'

see docs for details instruction

Contributing

  1. Fork it
  2. Commit your changes (git commit -am 'My Changes')
  3. Push your changes (git push origin)
  4. Create a new Pull Request
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].