-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update controllers to use ContentItemLoader
- Now that ContentItemLoader handles caching we can use that rather than the stuff that the format constraints were putting into the request env. - LandingPageController's scaffolding is still needed for the moment, but we can remove it soon (since part of this project is about replacing that scaffolding with a more generally useful one).
- Loading branch information
Showing
3 changed files
with
13 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
class ErrorController < ApplicationController | ||
def handler | ||
# defer any errors to be handled in ApplicationController | ||
raise request.env[:content_item_error] | ||
# We know at this point that the ContentItemLoader has stored | ||
# an exception to deal with, so just retrieve it and raise it | ||
# to be handled in ApplicationController | ||
raise ContentItemLoader.load(request.path) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters