Class: FormForms::Elements::Fieldset
- Inherits:
-
SubForm
- Object
- BaseElement
- SubForm
- FormForms::Elements::Fieldset
- Defined in:
- lib/form_forms/elements/fieldset.rb
Instance Attribute Summary
Attributes inherited from BaseElement
Instance Method Summary collapse
-
#initialize(args = {}, &generator) ⇒ Fieldset
constructor
A new instance of Fieldset.
-
#render(builder, view) ⇒ Object
Generate a fielset with a legend.
Methods inherited from BaseElement
Constructor Details
#initialize(args = {}, &generator) ⇒ Fieldset
Returns a new instance of Fieldset.
4 5 6 7 8 9 |
# File 'lib/form_forms/elements/fieldset.rb', line 4 def initialize(args={}, &generator) self.legend nil self.args args super end |
Instance Method Details
#render(builder, view) ⇒ Object
Generate a fielset with a legend
15 16 17 18 19 20 21 22 23 |
# File 'lib/form_forms/elements/fieldset.rb', line 15 def render(builder, view) args = eval_property(:args, builder, view) legend = eval_property(:legend, builder, view) view.content_tag(:fieldset, args) do view.concat view.content_tag(:legend, legend) unless legend.nil? view.concat render_elements(builder, view) end end |