Sha256: 6f63033a5ef30453a885a39d87a6f80610ac37ba03e39130a65068fbec4a9f95

Contents?: true

Size: 542 Bytes

Versions: 7

Compression:

Stored size: 542 Bytes

Contents

class <%= datatable_name %> < AjaxDatatablesRails::ActiveRecord

  def view_columns
    # Declare strings in this format: ModelName.column_name
    # or in aliased_join_table.column_name format
    @view_columns ||= {
      # id: { source: "User.id", cond: :eq },
      # name: { source: "User.name", cond: :like }
    }
  end

  def data
    records.map do |record|
      {
        # example:
        # id: record.id,
        # name: record.name
      }
    end
  end

  def get_raw_records
    # insert query here
    # User.all
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ajax-datatables-rails-1.5.0 lib/generators/rails/templates/datatable.rb
ajax-datatables-rails-1.4.0 lib/generators/rails/templates/datatable.rb
ajax-datatables-rails-1.3.1 lib/generators/rails/templates/datatable.rb
ajax-datatables-rails-1.3.0 lib/generators/rails/templates/datatable.rb
ajax-datatables-rails-1.2.0 lib/generators/rails/templates/datatable.rb
ajax-datatables-rails-1.1.0 lib/generators/rails/templates/datatable.rb
ajax-datatables-rails-1.0.0 lib/generators/rails/templates/datatable.rb