Rails中遇到错误跳转到统一提示错误页的方法

2019-09-25 09:47:32王旭

 
  def render_access_denied(exception) 
    case exception 
    when *ACCESS_DENIED_CLASSES then exception_class = exception.class.to_s 
    else exception_class = "Exception" 
    end 
 
    send_error_email(exception, exception_class) 
  end