# Validations

**URL:** <https://www.ruby-forum.com/t/validations/135264>\
**Category:** Rails\
**Created:** [April 20, 2008, 9:38am UTC](https://www.ruby-forum.com/t/validations/135264 "2008-04-20T09:38:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anasmd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e495f1/32.png) [@anasmd](https://www.ruby-forum.com/u/anasmd)\
**Post date:** [April 20, 2008, 9:38am UTC](https://www.ruby-forum.com/t/validations/135264/1 "2008-04-20T09:38:30Z")

</div>

plzzz… any one help me in validations…  
that how can i connect to application.js(in ‘public’ folder) for simple  
validations such as ‘emptyness’ or ‘numericality’ from my view before  
going to  
submit to database  
thanq…  
md anas

---

<div class="post-metadata">

**Author:** ![anasmd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e495f1/32.png) [@anasmd](https://www.ruby-forum.com/u/anasmd)\
**Post date:** [April 20, 2008, 2:06pm UTC](https://www.ruby-forum.com/t/validations/135264/2 "2008-04-20T14:06:16Z")

</div>

Those kinds of validations are declared on your models. They’re called  
validates\_presence\_of and validates\_numericality\_of, respectively. Rails  
will check that your models pass any declared validations when  
saving/updating them, and it makes it very easy to display any errors in  
your view.  
Regards,  
Craig
