aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorZachary Scott <e@zzak.io>2014-12-11 18:30:35 -0500
committerZachary Scott <e@zzak.io>2014-12-11 18:30:35 -0500
commitb5001ea4d82d5bff21510b1315ca0db2fdaa186b (patch)
tree7c3c24142b24a315462425d82486a8464f9fc942 /guides
parent6cb956592cc5deb5496729f1e09ca9a4cc22868c (diff)
parentcbcec99fdbd635bba77bcc94c8622369690bdb4a (diff)
downloadrails-b5001ea4d82d5bff21510b1315ca0db2fdaa186b.tar.gz
rails-b5001ea4d82d5bff21510b1315ca0db2fdaa186b.tar.bz2
rails-b5001ea4d82d5bff21510b1315ca0db2fdaa186b.zip
Merge pull request #17815 from yuki24/remove-custom-errors-page-section
Remove custom errors page section from the guides [ci skip]
Diffstat (limited to 'guides')
-rw-r--r--guides/source/action_controller_overview.md59
1 files changed, 1 insertions, 58 deletions
diff --git a/guides/source/action_controller_overview.md b/guides/source/action_controller_overview.md
index 1ca0d9ed55..4e36a62583 100644
--- a/guides/source/action_controller_overview.md
+++ b/guides/source/action_controller_overview.md
@@ -1164,67 +1164,10 @@ class ClientsController < ApplicationController
end
```
-WARNING: You shouldn't do `rescue_from Exception` or `rescue_from StandardError` unless you have a particular reason as it will cause serious side-effects (e.g. you won't be able to see exception details and tracebacks during development). If you would like to dynamically generate error pages, see [Custom errors page](#custom-errors-page).
+WARNING: You shouldn't do `rescue_from Exception` or `rescue_from StandardError` unless you have a particular reason as it will cause serious side-effects (e.g. you won't be able to see exception details and tracebacks during development).
NOTE: Certain exceptions are only rescuable from the `ApplicationController` class, as they are raised before the controller gets initialized and the action gets executed. See Pratik Naik's [article](http://m.onkey.org/2008/7/20/rescue-from-dispatching) on the subject for more information.
-
-### Custom errors page
-
-You can customize the layout of your error handling using controllers and views.
-First define your app own routes to display the errors page.
-
-* `config/application.rb`
-
- ```ruby
- config.exceptions_app = self.routes
- ```
-
-* `config/routes.rb`
-
- ```ruby
- match '/404', via: :all, to: 'errors#not_found'
- match '/422', via: :all, to: 'errors#unprocessable_entity'
- match '/500', via: :all, to: 'errors#server_error'
- ```
-
-Create the controller and views.
-
-* `app/controllers/errors_controller.rb`
-
- ```ruby
- class ErrorsController < ActionController::Base
- layout 'error'
-
- def not_found
- render status: :not_found
- end
-
- def unprocessable_entity
- render status: :unprocessable_entity
- end
-
- def server_error
- render status: :server_error
- end
- end
- ```
-
-* `app/views`
-
- ```
- errors/
- not_found.html.erb
- unprocessable_entity.html.erb
- server_error.html.erb
- layouts/
- error.html.erb
- ```
-
-Do not forget to set the correct status code on the controller as shown before.
-
-WARNING: You should avoid using the database or any complex operations because the user is already on the error page. Generating another error while on an error page could cause issues like presenting an empty page for the users.
-
Force HTTPS protocol
--------------------