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, *args) ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/table_builder/table_builder.rb', line 3 def table_for(objects, *args) raise ArgumentError, "Missing block" unless block_given? = args.last.is_a?(Hash) ? args.pop : {} = [:html] builder = [:builder] || TableBuilder content_tag(:table, ) do yield builder.new(objects || [], self, ) end end |