ruby-on-rails – Rails:关闭错误显示
发布时间:2020-12-17 03:47:09 所属栏目:百科 来源:网络整理
导读:当我通过URL / posts / 13访问我的Rails项目中不存在的帖子时,浏览器会显示一个详细错误: ActiveRecord::RecordNotFound in PostsController#showCouldn't find Post with ID=13Rails.root: ......RequestParameters:{"id"="13"}... 有没有办法关闭这个详细
当我通过URL / posts / 13访问我的Rails项目中不存在的帖子时,浏览器会显示一个详细错误:
ActiveRecord::RecordNotFound in PostsController#show Couldn't find Post with ID=13 Rails.root: ... ... Request Parameters: {"id"=>"13"} ... 有没有办法关闭这个详细的错误显示? 解决方法
试试这个:
>在生产中运行服务器$rails s -e production config.middleware.delete(ActionDispatch :: DebugExceptions)>在环境配置中设置config.consider_all_requests_local = false (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |