Class: Dima::Html::ArrayField

Inherits:
SimpleField show all
Defined in:
lib/dima/html/field.rb

Instance Attribute Summary collapse

Attributes inherited from SimpleField

#height, #klass, #lambda, #model, #name, #readonly, #width

Attributes inherited from Field

#after, #align, #before, #edit, #form, #has_errors, #hint, #label, #required, #tooltip, #url

Instance Method Summary collapse

Methods inherited from SimpleField

#<<, #>>, #empty?, #main_content_node, #readonly?

Methods inherited from Field

#after_node, #before_node, #edit?, #empty_node, #label_node, #options, #to_n, #url_node, #val, #val=, #validate, #value_node

Methods included from Init

#initialize

Methods inherited from Element

#id, #id=

Instance Attribute Details

#fieldObject

Returns the value of attribute field.



408
409
410
# File 'lib/dima/html/field.rb', line 408

def field
  @field
end

Instance Method Details

#simple_value_nodeObject



410
411
412
413
414
415
416
417
418
419
# File 'lib/dima/html/field.rb', line 410

def simple_value_node
  ary = Node.new(tag: 'div', attributes: { class: 'dim-main-content dim-array' })
  self.val.each do |v|
    self.field << v
    item = Node.new(tag: 'div', attributes: { class: 'dim-array-item' })
    item << self.field.main_content_node
    ary << item
  end
  ary
end