Class: FormForms::Elements::TableHeader

Inherits:
BaseElement show all
Defined in:
lib/form_forms/elements/table_header.rb

Instance Attribute Summary

Attributes inherited from BaseElement

#elements

Instance Method Summary collapse

Methods inherited from BaseElement

#delete

Constructor Details

#initialize(row_args = {}) ⇒ TableHeader

Returns a new instance of TableHeader.



6
7
8
9
# File 'lib/form_forms/elements/table_header.rb', line 6

def initialize(row_args={})
  self.row_args row_args
  super
end

Instance Method Details

#render(builder, view) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/form_forms/elements/table_header.rb', line 13

def render(builder, view)
  return "" if self.elements.empty?

  row_args = eval_property(:row_args, builder, view)
  view.(:tr, row_args) do
    super
  end
end