# Validate list of items

**URL:** <https://www.ruby-forum.com/t/validate-list-of-items/178969>\
**Category:** Rails\
**Created:** [November 14, 2009, 1:17pm UTC](https://www.ruby-forum.com/t/validate-list-of-items/178969 "2009-11-14T13:17:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shaki](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8491ac/32.png) [@shaki](https://www.ruby-forum.com/u/shaki)\
**Post date:** [November 14, 2009, 1:17pm UTC](https://www.ruby-forum.com/t/validate-list-of-items/178969/1 "2009-11-14T13:17:24Z")

</div>

Hi,  
I am new to Ruby on Rails. I have to validate the number of items in a  
text box separated by colon. No of items also get from the user. Is  
there a way to do this using ruby active records. Thanks in advance.

---

<div class="post-metadata">

**Author:** ![shaki](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8491ac/32.png) [@shaki](https://www.ruby-forum.com/u/shaki)\
**Post date:** [November 16, 2009, 5:39am UTC](https://www.ruby-forum.com/t/validate-list-of-items/178969/2 "2009-11-16T05:39:36Z")

</div>

Hi Shakya Bandara

Read this especially validates\_length\_of

[http://guides.rubyonrails.org/activerecord\_validations\_callbacks.html](http://guides.rubyonrails.org/activerecord_validations_callbacks.html)

Sijo
