Ruby on Rails: how to get error messages from a child resource displayed?
Add a validation block in the School model to merge the errors: class School < ActiveRecord::Base has_many :students validate do |school| school.students.each do |student| next if student.valid? student.errors.full_messages.each do |msg| # you can customize the error message here: errors.add_to_base(“Student Error: #{msg}”) end end end end Now @school.errors will contain the correct errors: format.xml { render … Read more