Class: Kiss::Form::Column

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

Instance Method Summary collapse

Constructor Details

#initialize(form = nil) ⇒ Column

Returns a new instance of Column.



41
42
43
44
# File 'lib/kiss/form.rb', line 41

def initialize(form = nil)
  @_form = form
  @_components = []
end

Instance Method Details

#components_htmlObject Also known as: fields_html

Renders HTML for form fields.



47
48
49
50
51
# File 'lib/kiss/form.rb', line 47

def components_html
  @_components.map do |component|
    form.component_html(component)
  end.join
end

#htmlObject



64
65
66
67
68
69
70
71
72
# File 'lib/kiss/form.rb', line 64

def html
  [
    '<td class="kiss_form_column">',
    table_html_open,
    components_html,
    table_html_close,
    '</td>'
  ].join
end

#table_html_closeObject

Renders close of form table.



60
61
62
# File 'lib/kiss/form.rb', line 60

def table_html_close
  '</tbody></table>'
end

#table_html_openObject

Renders open of form table.



55
56
57
# File 'lib/kiss/form.rb', line 55

def table_html_open
  %Q(<table class="kiss_form_column" border=0 cellspacing=0><tbody>)
end