Method: Forma::Helpers#table_for

Defined in:
lib/forma/helpers.rb

#table_for(models, opts = {}, &block) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/forma/helpers.rb', line 22

def table_for(models, opts = {}, &block)
  opts[:models] = models
  opts[:context] = block
  t = Forma::Table.new(opts)
  (yield t) if block_given?
  t.to_html.to_s
end