diff options
author | Mauro George <maurogot@gmail.com> | 2015-07-02 18:41:20 -0300 |
---|---|---|
committer | Mauro George <maurogot@gmail.com> | 2016-01-11 19:27:19 -0200 |
commit | 43800057fc1cabe626f00d30dc302e2dde56fdfd (patch) | |
tree | 706d5f320861c56fb0e0272338f37ec235d235e8 /guides | |
parent | 83215b86fe46d2974c472436dc3337581d17829c (diff) | |
download | rails-43800057fc1cabe626f00d30dc302e2dde56fdfd.tar.gz rails-43800057fc1cabe626f00d30dc302e2dde56fdfd.tar.bz2 rails-43800057fc1cabe626f00d30dc302e2dde56fdfd.zip |
Add a note on ActionController guide about 404
[ci skip]
Diffstat (limited to 'guides')
-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 -------------------- |