validation on a has_many relationship

flash[:error] = @request.errors.full_messages.join(', ')

    That is correct I get the same result when use
      But my problem is when email and name blank, I dont get the error
message flash as

Name should not be blank
Email should not be blank

   but I get error like

     contacts is invalid

   But if suppose my request model too has a validation like
validates_presence_of :reason, :message => 'Reason should not be blank'

     I get the whole flash[error] like

   Reason should not be blank
   contacts is invalid

      Why the individual error messages of contact model not appearing?


You need to get the contact's errors from the contact. Try this out:

      @request =[:request])
      @request.contacts << contact =[:contact]
        # everything's fine
        flash[:error] = @request.errors.full_messages.join(', ') +
contact.errors.full_messages.join(', ')

No hope Again it shows

contacts is invalid
  rather than the actual message what I expected