Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove one more place where core knows about pages and move it to pag…
…es instead.
- Loading branch information
Showing
4 changed files
with
38 additions
and
19 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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
module Refinery | ||
module Pages | ||
module Admin | ||
module InstanceMethods | ||
|
||
def error_404(exception=nil) | ||
if (@page = Page.find_by_menu_match("^/404$", :include => [:parts, :slugs])).present? | ||
params[:action] = 'error_404' | ||
# change any links in the copy to the admin_root_path | ||
# and any references to "home page" to "Dashboard" | ||
part_symbol = Page.default_parts.first.to_sym | ||
@page[part_symbol] = @page[part_symbol].to_s.gsub( | ||
/href=(\'|\")\/(\'|\")/, "href='#{admin_root_path}'" | ||
).gsub("home page", "Dashboard") | ||
|
||
render :template => "/pages/show", | ||
:layout => layout?, | ||
:status => 404 | ||
else | ||
super | ||
end | ||
end | ||
|
||
end | ||
end | ||
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
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