From 491020b6df47e5404770ec3d8ce74cc32b61a8a6 Mon Sep 17 00:00:00 2001 From: z9hang Date: Wed, 22 Oct 2014 14:53:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9403,404=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0layout=EF=BC=8C=E4=BC=A0=E5=85=A5=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E5=85=B6=E4=BB=96=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 1d94d9a7c..67948a8e1 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -499,19 +499,19 @@ class ApplicationController < ActionController::Base def render_403(options={}) @project = nil - #render_error({:message => :notice_not_authorized, :status => 403}.merge(options)) - render :template => 'common/403' + render_error({:message => :notice_not_authorized, :status => 403}.merge(options),'common/403') + #render :template => 'common/403' return false end def render_404(options={}) - #render_error({:message => :notice_file_not_found, :status => 404}.merge(options)) - render :template => 'common/404' + render_error({:message => :notice_file_not_found, :status => 404}.merge(options),'common/404') + #render :template => 'common/404' return false end # Renders an error response - def render_error(arg) + def render_error(arg,template = 'common/error') arg = {:message => arg} unless arg.is_a?(Hash) @message = arg[:message] @lay = arg[:layout] @@ -521,9 +521,9 @@ class ApplicationController < ActionController::Base respond_to do |format| format.html { if @lay - render :template => 'common/error', :layout => @lay,:status => @status + render :template => template, :layout => @lay,:status => @status else - render :template => 'common/error', :layout => use_layout, :status => @status + render :template => template, :layout => use_layout, :status => @status end }