I\'m having a difficult time understanding how to get Rails to show an explicit error message for a child resource that is failing validation when I render an XML template.
You should use following in the rhtml.
<%= error_messages_for :school, :student %>
To skip "Students is invalid" message use following in the student.rb
def after_validation
# Skip errors that won't be useful to the end user
filtered_errors = self.errors.reject{ |err| %w{ student}.include?(err.first) }
self.errors.clear
filtered_errors.each { |err| self.errors.add(*err) }
end
EDITED
Sorry after_validation must be in a school.rb