Created
January 12, 2010 20:53
-
-
Save jacqui/275598 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
rescue_from ActiveResource::BadRequest, :with => :ar_bad_request | |
def ar_bad_request(e) | |
@message = e.message | |
respond_to do |format| | |
format.html { render :template => "#{RAILS_ROOT}/public/something.html", :layout => false, :status => 400} | |
format.xml { render :template => "api/something.xml", :status => 400, :content_type => 'application/xml' } | |
format.json { render :template => "api/something.json", :status => 400, :content_type => 'application/json' } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment