Sha256: 0e305e4f946a44f906ad1a6b2beb22b7cf6177707462936af69bda5e42df49d9

Contents?: true

Size: 618 Bytes

Versions: 2

Compression:

Stored size: 618 Bytes

Contents

class <%= @datatable_name %>Datatable < AjaxDatatablesRails::Base

  def sortable_columns
    # Declare strings in this format: ModelName.column_name
    @sortable_columns ||= []
  end

  def searchable_columns
    # Declare strings in this format: ModelName.column_name
    @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

2 entries across 2 versions & 1 rubygems

Version Path
ajax-datatables-rails-0.3.1 lib/generators/rails/templates/datatable.rb
ajax-datatables-rails-0.3.0 lib/generators/rails/templates/datatable.rb