Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 0a3bc8479f
Fetching contributors…

Cannot retrieve contributors at this time

28 lines (24 sloc) 0.866 kb
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
Jump to Line
Something went wrong with that request. Please try again.