Module: TableHelper

Includes:
ActionView::Helpers::TagHelper
Defined in:
lib/rails_table_for/table_helper.rb

Instance Method Summary collapse

Instance Method Details

#table_for(records, **options) {|table| ... } ⇒ Object

Yields:

  • (table)


8
9
10
11
12
13
# File 'lib/rails_table_for/table_helper.rb', line 8

def table_for(records, **options)
  options.merge!(request_options)
  table = Elements::Table.new(records, options)
  yield table if block_given?
  table.to_s
end