# Validate for a groups of at least 4 items

**URL:** <https://www.ruby-forum.com/t/validate-for-a-groups-of-at-least-4-items/108222>\
**Category:** Rails\
**Created:** [June 30, 2007, 11:16am UTC](https://www.ruby-forum.com/t/validate-for-a-groups-of-at-least-4-items/108222 "2007-06-30T11:16:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hfoobar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/45deac/32.png) [@hfoobar](https://www.ruby-forum.com/u/hfoobar)\
**Post date:** [June 30, 2007, 11:16am UTC](https://www.ruby-forum.com/t/validate-for-a-groups-of-at-least-4-items/108222/1 "2007-06-30T11:16:08Z")

</div>

HI all,

I have 2 tables: groups and items. The relation is 1-\* (each group has  
many items). In reality each groups should have at least 4 items.

How can I implement an input form so I can input 4 items at the same  
time?

And how can I validate the input to ensure that each group must have \>=4  
items?

Thank you so much for replies.

– ruby/rails newbie
