New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove custom errors page section from the guides #17815
Conversation
539d7e2
to
a4f9479
Compare
Yep, we generally don't link to external material, gems, videos, talks, etc. |
Yeah, I don't think linking is a good idea at this point. I'll remove it. |
This pattern is too problematic and introduces a lot of edge cases: * On 4.2, the issue rails#15124 is back again. * needs to define each action for each http status otherwise the router raises ActionController::RoutingError (No route matches). * If the router has `match "/*username",...` and some action is missing, Rails will pick up the "match" and try to do its job. * encourages people to copy & paste programming. Not DRY. [ci skip]
a4f9479
to
cbcec99
Compare
updated. |
Any chance to get this merged into master and 4-2-stable? I really don't want any more people to follow this pattern. |
@rafaelfranca Sorry for pushing this again, but please do consider merging this before 4.2.0 is out. |
Remove custom errors page section from the guides [ci skip]
Remove custom errors page section from the guides [ci skip]
@yuki24 committed and backported in 11bbf15 @rafaelfranca What is |
@zzak Thanks! |
@zzak it is the release branch. The release will be done from that branch. You should backport it too. |
As of rails 4.2 it's no longer mentioned in the guide as something to consider doing to get dynamic error pages. See: rails/rails#17815 Setting an exceptions_app is still documented, but setting it to self.routes is not. It still works for us, but we should be aware that this might be a blocker to future upgrades.
This pattern is error-prone and introduces a lot of edge cases:
ActionController::RoutingError (No route matches)
.match "/*username",...
and an error page action is missing, Rails would pick up the "match" route and try to render the user's page.I've seen many people who have done this, most of which have run into an issue. I believe we should stop doing
config.exceptions_app = self.routes
and use static error pages, or use the rambulance gem as a temporary solution.