# Overriding the error\_messages\_for method

**URL:** <https://www.ruby-forum.com/t/overriding-the-error-messages-for-method/53684>\
**Category:** Rails\
**Created:** [February 13, 2006, 6:59pm UTC](https://www.ruby-forum.com/t/overriding-the-error-messages-for-method/53684 "2006-02-13T18:59:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/59ef9b/32.png) [@johnk](https://www.ruby-forum.com/u/johnk)\
**Post date:** [February 13, 2006, 6:59pm UTC](https://www.ruby-forum.com/t/overriding-the-error-messages-for-method/53684/1 "2006-02-13T18:59:37Z")

</div>

If I wanted to override the error\_messages\_for method where within  
the rails structure would I put it? Which file?

Thanks 🙂

John K.  
[http://www.kopanas.com](http://www.kopanas.com)

=====================================================================  
[http://www.soen.info](http://www.soen.info) - source of the freshest software engineering  
information on the net  
[http://cusec.soen.info](http://cusec.soen.info) - software engineering conference

---

<div class="post-metadata">

**Author:** ![johnk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/59ef9b/32.png) [@johnk](https://www.ruby-forum.com/u/johnk)\
**Post date:** [February 13, 2006, 8:46pm UTC](https://www.ruby-forum.com/t/overriding-the-error-messages-for-method/53684/2 "2006-02-13T20:46:47Z")

</div>

Its a built in helper function. So, if you put your own  
error\_messages\_for method in your application.rb (or any other helper  
you want) you should be good to go. (maybe) 🙂

-Nick

---

<div class="post-metadata">

**Author:** ![johnk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/59ef9b/32.png) [@johnk](https://www.ruby-forum.com/u/johnk)\
**Post date:** [February 13, 2006, 9:06pm UTC](https://www.ruby-forum.com/t/overriding-the-error-messages-for-method/53684/3 "2006-02-13T21:06:00Z")

</div>

I did this not too long ago, and it works like a charm !  
The reason I wanted to do this was to change the default error message,  
and,  
to enable error  
messages for multiple models to be diplayed nicely.

Search this list for a thread titled “Multiple Model Validation”

# HTH !

Dylan
