method
rescue_action_in_public
Ruby on Rails latest stable (v7.1.3.2)
-
2 notes -
Class: ActionController::Rescue
- 1.0.0 (0)
- 1.1.6 (0)
- 1.2.6 (0)
- 2.0.3 (20)
- 2.1.0 (0)
- 2.2.1 (0)
- 2.3.8 (1)
- 3.0.0
- 3.0.9
- 3.1.0
- 3.2.1
- 3.2.8
- 3.2.13
- 4.0.2
- 4.1.8
- 4.2.1
- 4.2.7
- 4.2.9
- 5.0.0.1
- 5.1.7
- 5.2.3
- 6.0.0
- 6.1.3.1
- 6.1.7.7
- 7.0.0
- 7.1.3.2
- 7.1.3.4
- What's this?
rescue_action_in_public(exception)
protected
Overwrite to implement public exception handling (for requests answering false to local_request?). By default will call render_optional_error_file. Override this method to provide more user friendly error messages.
Register or
log in
to add new notes.
robinshe -
June 23, 2010
1 thank
how I use it
def rescue_action_in_public(exception)
case exception when ActiveRecord::RecordNotFound, ActionController::UnknownAction, ActionController::RoutingError redirect_to errors_path(404), :status=>301 else redirect_to errors_path(500) end
end
henning -
March 25, 2010
0 thanks
How to test custom error pages
Here is some advice for testing custom error pages using Webrat and Cucumber:
http://gem-session.com/2010/03/testing-your-custom-error-pages-with-webrat-and-cucumber