Forum: Ruby on Rails Showing error messages for two models as one heading

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Navjeet C. (Guest)
on 2006-01-24 06:37
I have two models Program and PointOfContact and here is their

Program belongs_to PointOfContact
PointOfContact has one Program

There is a single form to input a program and it's associated point of
contact information. The default behaviour in Rails seeems to be to show
two different error messages (boxes) on the top of the form if there are
validation errors in both models. Is there anyway to override that to
show just one error message heading e.g.

<heading>Program could not be saved because of errors</heading>

 <subError>Program name is blank.</subError>
 <subError>Point of Contact phone number is blank.</subError>


This topic is locked and can not be replied to.