Class: AgileFormFields::TextArea
- Inherits:
-
AgileFormField
- Object
- AgileFormField
- AgileFormFields::TextArea
- Defined in:
- app/models/agile_form_fields/text_area.rb
Overview
Implementation of text_area AgileRails form field.
===Form options:
type:text_area (required)name:Field name (required)html:html options which apply to text_area field (optional)
Form example:
10:
name: css
type: text_area
size: 100x30
Instance Attribute Summary
Attributes inherited from AgileFormField
Instance Method Summary collapse
-
#render ⇒ Object
Render text_area AgileRails form field code.
-
#ro_standard ⇒ Object
Return value for readonly field.
Methods inherited from AgileFormField
get_data, #hash_to_options, #html, #initialize, #options_to_hash, #record_text_for, #set_css_code, #set_default_value, #set_initial_value, #set_style, #t
Constructor Details
This class inherits a constructor from AgileFormFields::AgileFormField
Instance Method Details
#render ⇒ Object
Render text_area AgileRails form field code
53 54 55 56 57 58 |
# File 'app/models/agile_form_fields/text_area.rb', line 53 def render set_initial_value record = record_text_for(@yaml['name']) @html += @env.text_area(record, @yaml['name'], @yaml['html']) self end |
#ro_standard ⇒ Object
Return value for readonly field
44 45 46 47 48 |
# File 'app/models/agile_form_fields/text_area.rb', line 44 def ro_standard value = @record[@yaml['name']] @html += "<div class='ar-readonly'>#{value.gsub("\n",'<br>')}</div>" unless value.blank? self end |