Sha256: c1b9ada5cfeff74d07cbb38742889955099aa60afe3fac5df65cf69162cacb7e
Contents?: true
Size: 761 Bytes
Versions: 10
Compression:
Stored size: 761 Bytes
Contents
module Trestle class Table class Builder < Trestle::Builder target :table def initialize(options={}) @table = Table.new(options) @output_buffer = ActionView::OutputBuffer.new end def row(options={}, &block) table.row = Row.new(options, &block) end def selectable_column(options={}) table.columns << SelectColumn.new(options) end def column(field, proc=nil, options={}, &block) if proc.is_a?(Hash) options = proc proc = nil end table.columns << Column.new(field, options, &(proc || block)) end def actions(options={}, &block) table.columns << ActionsColumn.new(options, &block) end end end end
Version data entries
10 entries across 10 versions & 1 rubygems