Class: Lapillus::FormTextComponent
- Inherits:
-
FormComponent
- Object
- Component
- FormComponent
- Lapillus::FormTextComponent
- Defined in:
- lib/lapillus/form_components.rb
Instance Attribute Summary
Attributes inherited from Component
#behaviours, #identifier, #model, #property, #visible
Instance Method Summary collapse
- #render_to_element(element) ⇒ Object
-
#value=(text) ⇒ Object
TODO: current form test are not real life enough TODO: use stringio in test instead of string.
Methods inherited from FormComponent
Methods inherited from Component
#add_behaviour, #behaviour, #has_behaviour?, #has_model?, #has_parent?, #initialize, #on_render, #parent, #path, #render_component, #response_page=, #session, #value, #visible?, #webpage
Constructor Details
This class inherits a constructor from Lapillus::Component
Instance Method Details
#render_to_element(element) ⇒ Object
29 30 31 32 33 34 |
# File 'lib/lapillus/form_components.rb', line 29 def render_to_element(element) super text = value text = '' if text.nil? # TODO: should this be done here, or is this the responsibility of the model ? render_text(element, text) end |
#value=(text) ⇒ Object
TODO: current form test are not real life enough TODO: use stringio in test instead of string
38 39 40 41 |
# File 'lib/lapillus/form_components.rb', line 38 def value=text text = text.string if (text.kind_of?(StringIO)) super(text) end |