# Accessing validation information from the controller

**URL:** <https://www.ruby-forum.com/t/accessing-validation-information-from-the-controller/149217>\
**Category:** Rails\
**Created:** [September 22, 2008, 4:06pm UTC](https://www.ruby-forum.com/t/accessing-validation-information-from-the-controller/149217 "2008-09-22T16:06:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![arachnd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/278dde/32.png) [@arachnd](https://www.ruby-forum.com/u/arachnd)\
**Post date:** [September 22, 2008, 4:06pm UTC](https://www.ruby-forum.com/t/accessing-validation-information-from-the-controller/149217/1 "2008-09-22T16:06:05Z")

</div>

Hi,  
Is there any way to access the validation information in a model from  
the controller? For example, to change the regular expression in a  
validates\_format\_of :name,  
:with =\> %r{^(A-Za-z){1,40}$} dynamically, or to use that  
regular expression in javascript. Is this possible?  
Thanks,  
Daniel
