class Forma::TableField

Table field.

Public Class Methods

new(h={}) click to toggle source
Calls superclass method Forma::SimpleField::new
# File lib/forma/field.rb, line 505
def initialize(h={})
  h = h.symbolize_keys
  h[:label] = false
  h[:force_nonempty] = true
  @table = Forma::Table.new(h[:table] || {})
  super(h)
end

Public Instance Methods

edit_element(val) click to toggle source
# File lib/forma/field.rb, line 518
def edit_element(val)
  el('div', text: 'NO IMPLEMENTATION')
end
table() { |table| ... } click to toggle source
# File lib/forma/field.rb, line 522
def table
  yield @table if block_given?
  @table
end
view_element(val) click to toggle source
# File lib/forma/field.rb, line 513
def view_element(val)
  @table.models = val
  @table.to_html
end