aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/errors_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/errors_controller.rb')
-rw-r--r--app/controllers/errors_controller.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/controllers/errors_controller.rb b/app/controllers/errors_controller.rb
index 1755e05..e1d5dcf 100644
--- a/app/controllers/errors_controller.rb
+++ b/app/controllers/errors_controller.rb
@@ -1,5 +1,7 @@
class ErrorsController < ApplicationController
layout "index"
+ skip_before_filter :check_format
+ before_filter :force_format
def render_error
@exception = env["action_dispatch.exception"]
@@ -28,4 +30,11 @@ class ErrorsController < ApplicationController
render "error", status: 500
end
end
+
+ private
+ def force_format
+ unless [:json, :html].include?(request.format.to_sym)
+ request.format = "html"
+ end
+ end
end