Module: Tabletastic::Helper
- Defined in:
- lib/tabletastic/helper.rb
Instance Method Summary collapse
-
#table_for(collection, *args, &block) ⇒ Object
returns and outputs a table for the given active record collection.
Instance Method Details
#table_for(collection, *args, &block) ⇒ Object
returns and outputs a table for the given active record collection
4 5 6 7 8 9 10 11 |
# File 'lib/tabletastic/helper.rb', line 4 def table_for(collection, *args, &block) block = Tabletastic.default_table_block unless block_given? klass = default_class_for(collection) = args. (, klass) result = capture { block.call(TableBuilder.new(collection, klass, self)) } content_tag(:table, result, [:html]) end |