Module: TableCloth::ActionViewExtension

Defined in:
lib/table_cloth/action_view_extension.rb

Instance Method Summary collapse

Instance Method Details

#simple_table_for(objects, options = {}, &block) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/table_cloth/action_view_extension.rb', line 3

def simple_table_for(objects, options={}, &block)
  view_context = self
  table = if block_given?
    TableCloth::Builder.build(objects, view_context, options) do |table|
      yield table
    end
  else
    TableCloth::Builder.build(objects, view_context, options)
  end

  table.to_s
end