From dcd6ceb0c90866272b3e75f9d34ef9f13cfb33c6 Mon Sep 17 00:00:00 2001 From: marksiemers Date: Wed, 15 Mar 2017 12:38:49 -0700 Subject: 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. --- guides/source/form_helpers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides') 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 -- cgit v1.2.3