# Nested Forms with has\_many associations with validations

**URL:** <https://www.ruby-forum.com/t/nested-forms-with-has-many-associations-with-validations/168894>\
**Category:** Rails\
**Created:** [May 27, 2009, 6:27am UTC](https://www.ruby-forum.com/t/nested-forms-with-has-many-associations-with-validations/168894 "2009-05-27T06:27:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![asoto](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/58956e/32.png) [@asoto](https://www.ruby-forum.com/u/asoto)\
**Post date:** [May 27, 2009, 6:27am UTC](https://www.ruby-forum.com/t/nested-forms-with-has-many-associations-with-validations/168894/1 "2009-05-27T06:27:08Z")

</div>

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.
