Module: TableHelper

Defined in:
lib/tablematic/helper.rb,
lib/tablematic/builder.rb

Defined Under Namespace

Classes: TableBuilder

Instance Method Summary collapse

Instance Method Details

#table_for(records, options = {}, &block) ⇒ Object



4
5
6
7
# File 'lib/tablematic/helper.rb', line 4

def table_for(records, options={}, &block)
  attr = options[:attributes] || records.first.attribute_names
  concat TableBuilder.new(records, attr, options).build(self, &block)
end