Module: TableHelper

Defined in:
lib/table_builder/table_builder.rb

Defined Under Namespace

Classes: TableBuilder

Instance Method Summary collapse

Instance Method Details

#table_for(objects = [], options = {}) ⇒ Object



3
4
5
6
7
# File 'lib/table_builder/table_builder.rb', line 3

def table_for objects = [], options = {}
  html_options = options.delete(:html)
  builder      = options.delete(:builder) || TableBuilder
  concat (:table, html_options) { yield builder.new(objects, self, options) }
end