Add a note on ActionController guide about 404
[ci skip]
This commit is contained in:
parent
83215b86fe
commit
43800057fc
@ -1118,7 +1118,7 @@ Rails default exception handling displays a "500 Server Error" message for all e
|
|||||||
|
|
||||||
### The Default 500 and 404 Templates
|
### 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`
|
### `rescue_from`
|
||||||
|
|
||||||
@ -1174,6 +1174,10 @@ 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).
|
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: 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.
|
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
|
Force HTTPS protocol
|
||||||
|
Loading…
Reference in New Issue
Block a user