Created
November 26, 2015 14:34
-
-
Save tarot/5405778d2f2b145a24bd to your computer and use it in GitHub Desktop.
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
class ApplicationController < ActionController::Base | |
rescue_from StandardError, with: :error500 | |
def error500 | |
respond_to do |format| | |
format.json { render json: {message: 'Internal Server Error'}, status: :internal_server_error } | |
# ↓こいつのContent-Typeをtext/htmlに固定したい | |
format.any { render 'error500', formats: :html, status: :internal_server_error } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment