Forum: Ruby on Rails Nested Forms with has_many associations with validations

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E4f80e42794094c98a40bfebef4ec292?d=identicon&s=25 Alex Sharp (ajsharp)
on 2009-05-27 06:27
I want to have a parent model that I can add child objects (via a
has_many association) using the rails 2.3 nested form syntax. However,
it seems like rails throws an error during validation of the parent
model if I have a validates_presence_of :parent_id defined in the child
model.

Is the only solution to this to remove the validates_presence_of
:parent_id? This seems like a hack-ish workaround.
This topic is locked and can not be replied to.