Class: FormForms::Elements::Fields

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

Instance Attribute Summary

Attributes inherited from BaseElement

#elements

Instance Method Summary collapse

Methods inherited from BaseElement

#delete

Constructor Details

#initialize(association, form_args = {}) ⇒ Fields

Returns a new instance of Fields.



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

def initialize(association, form_args={})
  self.association association
  self.args form_args
  super
end

Instance Method Details

#render(builder, view) ⇒ Object



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

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

  builder.association(association, form_args) do |sub_builder|
    super(sub_builder, view)
  end
end