Module: FormObjects::Nesting
- Included in:
- Base
- Defined in:
- lib/form_objects/nesting.rb
Instance Method Summary collapse
- #define_nested_writer_method(method_name) ⇒ Object
- #nested_form(attribute, form, options = {}) ⇒ Object
Instance Method Details
#define_nested_writer_method(method_name) ⇒ Object
9 10 11 |
# File 'lib/form_objects/nesting.rb', line 9 def define_nested_writer_method(method_name) alias_method :"#{method_name}_attributes=", :"#{method_name}=" end |
#nested_form(attribute, form, options = {}) ⇒ Object
3 4 5 6 7 |
# File 'lib/form_objects/nesting.rb', line 3 def nested_form(attribute, form, = {}) attribute(attribute, form, ) validates_associated(attribute) define_nested_writer_method(attribute) end |