Access denied, Please sign in and make sure you have proper permission.
good
我来做一下搬运工
application_controller.rb
def render_404
render_optional_error_file(404)
end
def render_403
render_optional_error_file(403)
end
def render_optional_error_file(status_code)
status = status_code.to_s
fname = %w(404 403 422 500).include?(status) ? status : 'unknown'
render template: "/errors/#{fname}", format: [:html],
handler: [:erb], status: status, layout: 'application'
end
当然了
我纳闷 这个需求应该不止我一个人
为什么 rails 默认放到 public 呢....
#4 楼 @dddx Web 应用无法处理的请求指向静态资源很合理啊
而且不光是 Rails 这样做吧?现在网站基本上报错页面都是 .html 页面