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

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Alex S. (Guest)
on 2009-05-27 08: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

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.