# Validate depending on action

**URL:** <https://www.ruby-forum.com/t/validate-depending-on-action/188141>\
**Category:** Rails\
**Created:** [May 6, 2010, 3:03pm UTC](https://www.ruby-forum.com/t/validate-depending-on-action/188141 "2010-05-06T15:03:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gregm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/bc79bd/32.png) [@gregm](https://www.ruby-forum.com/u/gregm)\
**Post date:** [May 6, 2010, 3:03pm UTC](https://www.ruby-forum.com/t/validate-depending-on-action/188141/1 "2010-05-06T15:03:33Z")

</div>

Hi,

Is it possible use validations depending on the action?

Greg

---

<div class="post-metadata">

**Author:** ![gregm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/bc79bd/32.png) [@gregm](https://www.ruby-forum.com/u/gregm)\
**Post date:** [May 6, 2010, 6:16pm UTC](https://www.ruby-forum.com/t/validate-depending-on-action/188141/2 "2010-05-06T18:16:49Z")

</div>

On May 6, 2:03 pm, Greg Ma [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi,
> 
> Is it possible use validations depending on the action?

Sort of - the :if/:unless options to validations are pretty powerful,  
but it’s not quite as simple as saying :action =\> :blah (apart from  
anything else the model shouldn’t really know anything about what the  
controller has been doing

Fred
