6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/refinery/pages/admin/instance_methods.rb', line 6
def error_404(exception=nil)
if (@page = Page.where(:menu_match => "^/404$").includes(:parts, :slugs).first).present?
params[:action] = 'error_404'
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
|