# Limiting Error Messages

**URL:** <https://www.ruby-forum.com/t/limiting-error-messages/190796>\
**Category:** Rails\
**Created:** [June 28, 2010, 12:10pm UTC](https://www.ruby-forum.com/t/limiting-error-messages/190796 "2010-06-28T12:10:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ants\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/6de8d8/32.png) [@Ants\_P](https://www.ruby-forum.com/u/Ants_P)\
**Post date:** [June 28, 2010, 12:10pm UTC](https://www.ruby-forum.com/t/limiting-error-messages/190796/1 "2010-06-28T12:10:16Z")

</div>

Hello,

I’m using Authlogic and I don’t like the error messages it provides for  
acts\_as\_authentic and I was wondering how to go about cleaning them up.

My point is, if a password/email are missing, then I get …

Email is too short (minimum is 6 characters)  
Email should look like an email address.  
Email can’t be blank  
Password is too short (minimum is 4 characters)  
Password doesn’t match confirmation  
Password confirmation is too short (minimum is 4 characters)

when all I really need is …  
Email can’t be blank  
Password can’t be blank

… if the fields are blank.

If the fields have a value, then I would like to check the length, if  
that  
is valid, then I would like to check format.

I wanted to override validation but all I’ve found in the docs are ways  
to  
enable or disable validation of certain fields through the Config.

And now I realise the same is true for rails in general. If you use more  
than one validates\_\* method, then you get more than one message. There  
doesn’t appear to be an order.

I’ve read this but it only whacks things on one line (form what I’ve  
seen of  
it) [http://railsforum.com/viewtopic.php?id=38068](http://railsforum.com/viewtopic.php?id=38068)

So how do you go about cleaning this up neatly? I don’t want 6 or more  
messages going back to the user.

Yes, I can go through the errors and delete ones I don’t want but that’s  
not  
ideal and writing my own validations is cool but the stuff is already  
there  
so why do it again?!

Suggestions, please?

CIA

-ants
