From: Cyrus Dev Date: 2008-12-17T13:09:04+09:00 Subject: Re: Validation Hi dusty , thanks for your reply. but I want to show error messages like it appears above forum like Following fields has problem Name email password in order they written in model I have many forms .. so is there a way to make generalize.. ? it's not good to write error message for each field and for each form.. dusty wrote: > On Dec 16, 6:47�am, Cyrus Dev wrote: >> >> 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) -- Posted via http://www.ruby-forum.com/.