Forum: Ruby on Rails Help with Validation errors

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Kim (Guest)
on 2007-01-22 20:55
(Received via mailing list)
I have a file field in the DB I want to be unique. In my form I have
the user select items from drop-downs and enter text in text boxes, the
file name is then made up of the values in these fields.

I am using validate_presence_of to make sure the user enters info into
all the fields. When a user does not enter info, an error is returned
and the field is highlighted with red.

I am using validate_uniqueness_of :file to ensure the file name is
unique. When it is not unique, an error is returned but no fields are
hightlighted.

I want to highlight the fields that comprise the file name. Is there a
way to tell the validation which fields to highlight?

Code examples are always helpful.
Thanks in advance - K
Kim (Guest)
on 2007-01-23 01:11
(Received via mailing list)
Hello - anyone know how to do this? Am I explaining myself OK?
Kim (Guest)
on 2007-01-23 19:47
(Received via mailing list)
Bump.Is there a way to do this?
This topic is locked and can not be replied to.