Skip to content

Instantly share code, notes, and snippets.

@qhoxie
Forked from paul/exceptions.rb
Created January 7, 2009 21:28
Show Gist options
  • Save qhoxie/44446 to your computer and use it in GitHub Desktop.
Save qhoxie/44446 to your computer and use it in GitHub Desktop.
class Exceptions < Application
# handle RecordInvalid exceptions (406)
def record_invalid
@errors = request.exceptions.first.errors
rename_error_fields!
if content_type == :html
render {:template => "#{request.controller}/#{request.params[:action]}"}
else
render
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment