作业打包下载错误提示页无导航问题

competition
z9hang 11 years ago
parent 7eb1a76734
commit 42f0c49093

@ -482,14 +482,19 @@ class ApplicationController < ActionController::Base
# Renders an error response
def render_error(arg)
arg = {:message => arg} unless arg.is_a?(Hash)
@message = arg[:message]
@lay = arg[:layout]
@message = l(@message) if @message.is_a?(Symbol)
@status = arg[:status] || 500
respond_to do |format|
format.html {
render :template => 'common/error', :layout => use_layout, :status => @status
if @lay
render :template => 'common/error', :layout => @lay,:status => @status
else
render :template => 'common/error', :layout => use_layout, :status => @status
end
}
format.any { head @status }
end

@ -1,4 +1,5 @@
class ZipdownController < ApplicationController
#查找项目(课程)
before_filter :find_project_by_bid_id, :only => [:assort]
#检查权限
@ -43,14 +44,15 @@ class ZipdownController < ApplicationController
zipfile = zip_homework_by_user homework
send_file zipfile, :filename => homework.name+".zip", :type => detect_content_type(zipfile) if(zipfile)
else
render_403 :message => :no_file_dowmload
render_403 :message => :no_file_dowmload ,:layout => "course_base"
end
else
render_403 :message =>:notice_file_not_found
render_403 :message =>:notice_file_not_found ,:layout => "course_base"
end
else
render_403 :message => :notice_not_authorized
render_403 :message => :notice_not_authorized ,:layout => "course_base"
end
rescue => e
render file: 'public/file_not_found.html'
end

Loading…
Cancel
Save