Module: HtmlTables::DataTableHelper

Defined in:
lib/html_tables/data_table_helper.rb

Instance Method Summary collapse

Instance Method Details

#data_table_for(collection, options = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/html_tables/data_table_helper.rb', line 5

def data_table_for(collection, options = {})
  config = HtmlTables::Configuration.instance

  table = DataTable.new(self, collection, options)
  if block_given?
    yield table.object_to_yield
  else
    table.auto_generate_columns!
  end

  Renderer.new(self, table, collection, options).to_html
end