Sha256: 67c39f5b226e0dc43cc3c065b5686b0ce5f2417bc0b60b3760e05016e1392287
Contents?: true
Size: 946 Bytes
Versions: 5
Compression:
Stored size: 946 Bytes
Contents
class <%= @datatable_name %>Datatable < AjaxDatatablesRails::Base # uncomment the appropriate paginator module, # depending on gems available in your project. # include AjaxDatatablesRails::Extensions::Kaminari # include AjaxDatatablesRails::Extensions::WillPaginate # include AjaxDatatablesRails::Extensions::SimplePaginator def sortable_columns # list columns inside the Array in string dot notation. # Example: 'users.email' @sortable_columns ||= [] end def searchable_columns # list columns inside the Array in string dot notation. # Example: 'users.email' @searchable_columns ||= [] end private def data records.map do |record| [ # comma separated list of the values for each cell of a table row # example: record.attribute, ] end end def get_raw_records # insert query here end # ==== Insert 'presenter'-like methods below if necessary end
Version data entries
5 entries across 5 versions & 1 rubygems