解决部分路由不正确报500问题,让其跳转至404

This commit is contained in:
huang 2017-01-10 09:19:37 +08:00
parent 1a2063fe7e
commit dc6a515f08
1 changed files with 6 additions and 1 deletions

View File

@ -51,7 +51,12 @@ class OrgSubfieldsController < ApplicationController
@organization = Organization.find(params[:id]) @organization = Organization.find(params[:id])
else else
domain = Secdomain.where("subname=?", request.subdomain).first domain = Secdomain.where("subname=?", request.subdomain).first
@organization = Organization.find(domain.pid) begin
@organization = Organization.find(domain.pid)
rescue
render_404
return
end
end end
if @organization.is_public? or User.current.admin? or User.current.member_of_org?(@organization) if @organization.is_public? or User.current.admin? or User.current.member_of_org?(@organization)
@org_subfield = OrgSubfield.find_by_sql("select distinct org_subfields.* from org_subfields,"+ @org_subfield = OrgSubfield.find_by_sql("select distinct org_subfields.* from org_subfields,"+