From: dusty Date: 2008-12-16T23:52:26+09:00 Subject: Re: Validation On Dec 16, 6:47 am, Cyrus Dev wrote: > Hi , > > any one know how to order validation messages in Rails > > I have model , with following validation like > > name, email, password > > but when it validates ,messages appear unordered..becuase rails store > validation messages in hash... > > so please how to solve this probelm > > thanks > -- > Posted viahttp://www.ruby-forum.com/. You can ask for specific error messages. I usually do that right above the field on the form. Say you have an item object with a location property. <%= error_message_on :item, :location %> <%= f.label :location %> <%= f.text_field :location %> That will add the location error message above it. Only when there is an error on the location property, will it show up. You can also pull specific errors with the on method on the errors collection. Say you have a user, with an error on the name property. u = User.new u.valid? u.errors.on(:name)