I am trying to display a custom 422 page in my application. What is the Exception class I am supposed to catch in the rescue_from declaration?
This how I handle the RecordNotFound exceptions:
rescue_from ActiveRecord::RecordNotFound, :with => :render_404
Well, there is a list that maps the exception class with appropriate status code. You go through this documentation. In your case, there are three:
ActiveRecord::RecordInvalid, ActiveRecord::RecordNotSaved, and ActionController::InvalidAuthenticityToken.