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, #table_row_html, #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.



487
488
489
490
491
# File 'lib/kiss/form/field.rb', line 487

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



493
494
495
496
497
498
499
500
501
502
# File 'lib/kiss/form/field.rb', line 493

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