# Errors

**URL:** <https://www.ruby-forum.com/t/errors/91431>\
**Category:** Rails\
**Created:** [April 9, 2007, 2:11am UTC](https://www.ruby-forum.com/t/errors/91431 "2007-04-09T02:11:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f04885/32.png) [@mick](https://www.ruby-forum.com/u/mick)\
**Post date:** [April 9, 2007, 2:11am UTC](https://www.ruby-forum.com/t/errors/91431/1 "2007-04-09T02:11:58Z")

</div>

Hello guys,

I have a question - I would like to use validation on a form I submit to  
the controller, so if (for example) an field is empty, it should add it  
to a list of errors, which I can then display beside any form fields for  
which that (or any other validation) applies.

Do you know of any good tutorials on the subject or can anyone offer a  
sample of controller/view code that utilizes validate(), etc, so I can  
see how it is meant to work? Agile Web Dev doesn’t really explain it  
clearly in one place I have found,

Thanks a bunch,

Mick

---

<div class="post-metadata">

**Author:** ![mick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f04885/32.png) [@mick](https://www.ruby-forum.com/u/mick)\
**Post date:** [April 9, 2007, 1:20pm UTC](https://www.ruby-forum.com/t/errors/91431/2 "2007-04-09T13:20:29Z")

</div>

> **[ActiveRecord::Validations](https://api.rubyonrails.org/classes/ActiveRecord/Validations.html)**
>
> Active Record Validations Active Record includes the majority of its validations from ActiveModel::Validations all of which accept the :on argument to define the context where the validations are act.

[http://api.rubyonrails.org/classes/ActiveRecord/Validations/ClassMethods.html](http://api.rubyonrails.org/classes/ActiveRecord/Validations/ClassMethods.html)
