# Order of displaying error messages

**URL:** <https://www.ruby-forum.com/t/order-of-displaying-error-messages/178419>\
**Category:** Rails\
**Created:** [November 4, 2009, 10:36am UTC](https://www.ruby-forum.com/t/order-of-displaying-error-messages/178419 "2009-11-04T10:36:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sharankruthi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/97f17d/32.png) [@sharankruthi](https://www.ruby-forum.com/u/sharankruthi)\
**Post date:** [November 4, 2009, 10:36am UTC](https://www.ruby-forum.com/t/order-of-displaying-error-messages/178419/1 "2009-11-04T10:36:27Z")

</div>

Hi,

Is it possible to display the error messages in a particular order of  
attributes.

ie in error\_messages\_for

After validation Name cant be blank etc… can be specify the order of  
attributes?

Thanks,

Sharanya

---

<div class="post-metadata">

**Author:** ![sharankruthi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/97f17d/32.png) [@sharankruthi](https://www.ruby-forum.com/u/sharankruthi)\
**Post date:** [November 4, 2009, 12:01pm UTC](https://www.ruby-forum.com/t/order-of-displaying-error-messages/178419/2 "2009-11-04T12:01:19Z")

</div>

Hi Sharanya S.

```
I think you will have to iterate through the @error variable and 

```

arrange it according to your need in controller.Dont know why are you  
doing it

Sijo

---

<div class="post-metadata">

**Author:** ![sharankruthi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/97f17d/32.png) [@sharankruthi](https://www.ruby-forum.com/u/sharankruthi)\
**Post date:** [November 4, 2009, 12:04pm UTC](https://www.ruby-forum.com/t/order-of-displaying-error-messages/178419/3 "2009-11-04T12:04:24Z")

</div>

Sijo k g wrote:

> Hi Sharanya S.
> 
> ```
> I think you will have to iterate through the @error variable and 
> 
> ```
> 
> arrange it according to your need in controller.Dont know why are you  
> doing it
> 
> Sijo

Thankx
