# Validation of acts\_as\_list in the model of the base class?

**URL:** <https://www.ruby-forum.com/t/validation-of-acts-as-list-in-the-model-of-the-base-class/124377>\
**Category:** Rails\
**Created:** [December 28, 2007, 5:57am UTC](https://www.ruby-forum.com/t/validation-of-acts-as-list-in-the-model-of-the-base-class/124377 "2007-12-28T05:57:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mukund](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e8c25b/32.png) [@Mukund](https://www.ruby-forum.com/u/Mukund)\
**Post date:** [December 28, 2007, 5:57am UTC](https://www.ruby-forum.com/t/validation-of-acts-as-list-in-the-model-of-the-base-class/124377/1 "2007-12-28T05:57:39Z")

</div>

Lets say I have 3 models, user, user\_group and user\_group\_nodes. A  
normal user has one user\_group\_id as a foreign key and a special user  
has multiple user\_groups which are defined in the user\_group\_nodes.  
The user\_group\_nodes is a “acts\_as\_list” for user and contains a list  
of group\_ids.

When I build a form to get user input and I want to save it, is there  
a way to validate the presence of the child nodes in the model of  
“user” so that I can permit the user to be saved only if the child  
nodes are validated? I also wanted to use the errors\_on etc. which  
are accessible only at the model level.

---

<div class="post-metadata">

**Author:** ![Mukund](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e8c25b/32.png) [@Mukund](https://www.ruby-forum.com/u/Mukund)\
**Post date:** [December 28, 2007, 6:00am UTC](https://www.ruby-forum.com/t/validation-of-acts-as-list-in-the-model-of-the-base-class/124377/2 "2007-12-28T06:00:35Z")

</div>

I think what you’re looking for is validates\_associated  
:user\_group\_nodes.

On Dec 28, 2007 3:27 PM, Mukund [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> nodes are validated? I also wanted to use the errors\_on etc. which  
> are accessible only at the model level.
> 
> >

–  
Ryan B.

> **[frozenplague.net](http://www.frozenplague.net)**
>
> This domain may be for sale!

Feel free to add me to MSN and/or GTalk as this email.
