Created
February 14, 2011 17:41
-
-
Save nickyp/826228 to your computer and use it in GitHub Desktop.
rescue_record_invalid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def rescue_record_invalid(e) | |
logger.info(e) | |
message = e.record.errors.map {|error| | |
"#{t('activerecord.attributes.' + error[0])} #{error[1]}" | |
}.join("\n") | |
respond_to do |format| | |
format.xml { | |
render :status => :unprocessable_entity, | |
:text => format_xml_exception(e, message) | |
} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment