mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
add nested_model_forms to guides/documents.yaml [wip] [ci skip]
This commit is contained in:
parent
58d9888e1e
commit
b4a9f00a45
1 changed files with 4 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
Rails nested model forms
|
||||
Rails Nested Model Forms
|
||||
========================
|
||||
|
||||
Creating a form for a model _and_ its associations can become quite tedious. Therefore Rails provides helpers to assist in dealing with the complexities of generating these forms _and_ the required CRUD operations to create, update, and destroy associations.
|
||||
|
@ -54,6 +54,9 @@ class Person < ActiveRecord::Base
|
|||
end
|
||||
```
|
||||
|
||||
NOTE: For greater detail on associations see [Active Record Associations](association_basics.html).
|
||||
For a complete reference on associations please visit the API documentation for [ActiveRecord::Associations::ClassMethods](http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html).
|
||||
|
||||
### Custom model
|
||||
|
||||
As you might have inflected from this explanation, you _don't_ necessarily need an ActiveRecord::Base model to use this functionality. The following examples are sufficient to enable the nested model form behavior:
|
||||
|
|
Loading…
Reference in a new issue