diff options
author | Jon Moss <maclover7@users.noreply.github.com> | 2016-01-11 16:40:08 -0500 |
---|---|---|
committer | Jon Moss <maclover7@users.noreply.github.com> | 2016-01-11 16:40:08 -0500 |
commit | ddfd51f270a9d915c64e83f73390c8642de44e23 (patch) | |
tree | 074d1ff1c9834b573e49e8f5871c7536059d8e22 | |
parent | dbf67b3a6f549769c5f581b70bc0c0d880d5d5d1 (diff) | |
parent | 43800057fc1cabe626f00d30dc302e2dde56fdfd (diff) | |
download | rails-ddfd51f270a9d915c64e83f73390c8642de44e23.tar.gz rails-ddfd51f270a9d915c64e83f73390c8642de44e23.tar.bz2 rails-ddfd51f270a9d915c64e83f73390c8642de44e23.zip |
Merge pull request #20762 from maurogeorge/record-not-found-doc
Add a note on ActionController guide about 404
-rw-r--r-- | guides/source/action_controller_overview.md | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/guides/source/action_controller_overview.md b/guides/source/action_controller_overview.md index d2e2d27737..f68f2d1faf 100644 --- a/guides/source/action_controller_overview.md +++ b/guides/source/action_controller_overview.md @@ -1118,7 +1118,7 @@ Rails default exception handling displays a "500 Server Error" message for all e ### The Default 500 and 404 Templates -By default a production application will render either a 404 or a 500 error message. These messages are contained in static HTML files in the `public` folder, in `404.html` and `500.html` respectively. You can customize these files to add some extra information and style, but remember that they are static HTML; i.e. you can't use ERB, SCSS, CoffeeScript, or layouts for them. +By default a production application will render either a 404 or a 500 error message, in the development environment all unhandled exceptions are raised. These messages are contained in static HTML files in the `public` folder, in `404.html` and `500.html` respectively. You can customize these files to add some extra information and style, but remember that they are static HTML; i.e. you can't use ERB, SCSS, CoffeeScript, or layouts for them. ### `rescue_from` @@ -1174,7 +1174,11 @@ 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). -NOTE: Certain exceptions are only rescuable from the `ApplicationController` class, as they are raised before the controller gets initialized and the action gets executed. +NOTE: When running in the production environment, all +`ActiveRecord::RecordNotFound` errors render the 404 error page. Unless you need +a custom behavior you don't need to handle this. + +NOTE: Certain exceptions are only rescuable from the `ApplicationController` class, as they are raised before the controller gets initialized and the action gets executed. Force HTTPS protocol -------------------- |