Class: FormForms::Elements::Block

Inherits:
SubForm show all
Defined in:
lib/form_forms/elements/block.rb

Instance Attribute Summary

Attributes inherited from BaseElement

#elements

Instance Method Summary collapse

Methods inherited from BaseElement

#delete

Constructor Details

#initialize(element, args = {}) ⇒ Block

Returns a new instance of Block.



4
5
6
7
8
# File 'lib/form_forms/elements/block.rb', line 4

def initialize(element, args = {})
  @element = element.to_sym
  self.args args
  super
end

Instance Method Details

#render(builder, view) ⇒ Object

Generate a fielset with a legend



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

def render(builder, view)
  args = eval_property(:args, builder, view)

  view.(@element, args) do
    super
  end
end