# Displaying error messages

**URL:** <https://www.ruby-forum.com/t/displaying-error-messages/142764>\
**Category:** Rails\
**Created:** [July 11, 2008, 6:06am UTC](https://www.ruby-forum.com/t/displaying-error-messages/142764 "2008-07-11T06:06:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![paradise](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/8e7dd6/32.png) [@paradise](https://www.ruby-forum.com/u/paradise)\
**Post date:** [July 11, 2008, 6:06am UTC](https://www.ruby-forum.com/t/displaying-error-messages/142764/1 "2008-07-11T06:06:33Z")

</div>

I am able to display error messages when a user tries to sign up for  
my site but doesnt pass the validations, but I am having trouble  
displaying them for another controller in my site. I have included:  
\<%= error\_messages\_for ‘spec’ %\> in my view spec controller but this  
only displays the single message defined in the controller:  
flash[:error] = “There was a problem updating.”

For my other user controller, when something doesnt pass the  
validations I get specific error messages like this:  
4 errors prohibited this user from being saved

There were problems with the following fields:

```
* Username is too short (minimum is 4 characters)
* Password doesn't match confirmation
* Password is too short (minimum is 4 characters)
* Email is too short (minimum is 5 characters)

```

Anyone know how to get these? And if so, how do you change the CSS of  
these messages?

Thanks so much.
