From 13ee0dc9b2ef3632aecfb80e1897f1862909b6aa Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 13 Oct 2014 10:31:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9403=E3=80=81403=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 6 ++- app/views/common/403.html | 41 ++++++++++++++++ app/views/common/404.html | 41 ++++++++++++++++ public/404.html | 58 +++++++++++++++-------- 4 files changed, 124 insertions(+), 22 deletions(-) create mode 100644 app/views/common/403.html create mode 100644 app/views/common/404.html diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 0d9fe62a8..50196f21e 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -495,12 +495,14 @@ class ApplicationController < ActionController::Base def render_403(options={}) @project = nil - render_error({:message => :notice_not_authorized, :status => 403}.merge(options)) + #render_error({:message => :notice_not_authorized, :status => 403}.merge(options)) + render :template => 'common/403' return false end def render_404(options={}) - render_error({:message => :notice_file_not_found, :status => 404}.merge(options)) + #render_error({:message => :notice_file_not_found, :status => 404}.merge(options)) + render :template => 'common/404' return false end diff --git a/app/views/common/403.html b/app/views/common/403.html new file mode 100644 index 000000000..8462570e4 --- /dev/null +++ b/app/views/common/403.html @@ -0,0 +1,41 @@ + + +
+ +The page you were trying to access doesn't exist or has been removed.
- + +