Module: FreeForm::Nested::ClassMethods
- Defined in:
- lib/freeform/form/nested.rb
Instance Attribute Summary collapse
-
#nested_forms ⇒ Object
Nested Forms ————————————————————————.
Instance Method Summary collapse
- #nested_form(attribute, options = {}, &block) ⇒ Object (also: #has_many, #has_one)
Instance Attribute Details
#nested_forms ⇒ Object
Nested Forms
10 11 12 |
# File 'lib/freeform/form/nested.rb', line 10 def nested_forms @nested_forms end |
Instance Method Details
#nested_form(attribute, options = {}, &block) ⇒ Object Also known as: has_many, has_one
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/freeform/form/nested.rb', line 12 def nested_form(attribute, ={}, &block) # Initialize the instance variables on the parent class initialize_instance_variables(attribute) # Define new nested class klass = define_nested_class(attribute, , &block) # Define methods for working with nested models define_nested_model_methods(attribute, klass) end |