diff options
author | marksiemers <mark.siemers@gmail.com> | 2017-03-15 12:38:49 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-15 12:38:49 -0700 |
commit | dcd6ceb0c90866272b3e75f9d34ef9f13cfb33c6 (patch) | |
tree | e65e0fe64bc817b2fd415a314ac37e58655096a0 | |
parent | bd3f0e706c08481bfe9f87db1f393d8c9be980c2 (diff) | |
download | rails-dcd6ceb0c90866272b3e75f9d34ef9f13cfb33c6.tar.gz rails-dcd6ceb0c90866272b3e75f9d34ef9f13cfb33c6.tar.bz2 rails-dcd6ceb0c90866272b3e75f9d34ef9f13cfb33c6.zip |
Update 'Building Complex Forms' with `inverse_of`
If the example for complex forms is implemented, ActiveRecord will prevent saving unless `inverse_of: :person` is added to the `has_many :addresses` association.
-rw-r--r-- | guides/source/form_helpers.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/guides/source/form_helpers.md b/guides/source/form_helpers.md index 0508b0fb38..95c2e33dc7 100644 --- a/guides/source/form_helpers.md +++ b/guides/source/form_helpers.md @@ -877,7 +877,7 @@ Active Record provides model level support via the `accepts_nested_attributes_fo ```ruby class Person < ApplicationRecord - has_many :addresses + has_many :addresses, inverse_of: :person accepts_nested_attributes_for :addresses end |