Class: TaoForm::Components::FieldComponent

Inherits:
TaoOnRails::Components::Base
  • Object
show all
Defined in:
lib/tao_form/components/field_component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(view, builder = nil, attribute_name = nil, options = {}) ⇒ FieldComponent

Returns a new instance of FieldComponent.



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/tao_form/components/field_component.rb', line 7

def initialize view, builder = nil, attribute_name = nil, options = {}
  if builder.is_a? Hash
    options = builder
    builder = nil
    attribute_name = nil
  end

  super view, options
  @builder = builder
  @attribute_name = attribute_name
end

Instance Attribute Details

#attribute_nameObject (readonly)

Returns the value of attribute attribute_name.



5
6
7
# File 'lib/tao_form/components/field_component.rb', line 5

def attribute_name
  @attribute_name
end

#builderObject (readonly)

Returns the value of attribute builder.



5
6
7
# File 'lib/tao_form/components/field_component.rb', line 5

def builder
  @builder
end