Replaced calls to deprecated methods f.error_messages and error_messages_for with a loop over the objects 'errors' attribute