Class: Kiss::Form::TextAreaField

Inherits:
Field show all
Defined in:
lib/kiss/form/field.rb

Constant Summary

Constants inherited from Field

Field::CURRENCY_SYMBOLS

Instance Method Summary collapse

Methods inherited from Field

#add_error, #content_tag_html, #debug, #errors_html, #html, #input_tag_html, #method_missing, #param, #require_value, #reset, #set_value_to_hash, #set_value_to_object, #tag_html, #tag_start_html, #tip_html, #type, #validate, #value, #value_string, #value_to_s

Constructor Details

#initialize(*args) ⇒ TextAreaField

Returns a new instance of TextAreaField.



482
483
484
485
486
# File 'lib/kiss/form/field.rb', line 482

def initialize(*args)
  @_rows = 5
  @_cols = 20
  super(*args)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Kiss::Form::Field

Instance Method Details

#element_html(attrs = {}) ⇒ Object



488
489
490
491
492
493
494
495
496
497
# File 'lib/kiss/form/field.rb', line 488

def element_html(attrs = {})
  (
    'textarea',
    value_string,
    attrs.merge(
      :rows => @_rows ||= 1,
      :cols => @_cols ||= 1
    )
  ) + tip_html(attrs)
end