I added this gem
gem 'jquery-datatables-rails', github: "rweng/jquery-datatables-rails", branch: "master"
and then updated my application.js and application.css with
//= require dataTables/jquery.dataTables
*= require dataTables/jquery.dataTables
Now in my products.js.coffee file
table = jQuery ->
$("#products").DataTable()
new jQuery.fn.dataTable.Buttons( table, {
buttons: [
'copy', 'excel', 'pdf'
]
})
table.buttons().container()
.appendTo( $('#exportButtons', table.table().container() ) )
and I'm getting the error
TypeError: c is undefined
I'm stuck and don't have any idea where is the problem. Is this datatable gem does not support the latest release of datatables export buttons
You might want to explicitly download and include JS & CSS files for button.
application.jslooks as follows-application.scsslooks as below-I have downloaded
buttonsextension for tables explicitly and added to the asset pipeline in folderDataTables&DatableStyles.Also don't forget to include
html5version of buttons-