[英]Purpose of “consider_all_requests_local” in config/environments/development.rb?
What is the purpose of this Rails config setting... 这个Rails配置设置的目的是什么......
config.action_controller.consider_all_requests_local = true
It's set to true by default in config/environments/development.rb
. 默认情况下,它在
config/environments/development.rb
设置为true。
Thanks, 谢谢,
Ethan 阮经天
Non-local requests result in user-friendly error pages. 非本地请求会导致用户友好的错误页面。 Local requests, assumed to come from developers, see a more useful error message that includes line numbers and a backtrace.
假定来自开发人员的本地请求会看到包含行号和回溯的更有用的错误消息。
consider_all_requests_local
allows your app to display these developer-friendly messages even when the machine making the request is remote. consider_all_requests_local
允许您的应用显示这些开发人员友好的消息,即使发出请求的计算机是远程的。
At development level we set: 在开发级别,我们设置:
consider_all_requests_local set = true
consideration_all_requests_local set = true
because developer needs to take a look at full error showing layout/view as you can see in the image below. 因为开发人员需要查看显示布局/视图的完整错误,如下图所示。
But at production level, we don't need to show our internal coding bug so we set false: 但是在生产级别,我们不需要显示内部编码错误,因此我们设置为false:
config.consider_all_requests_local = false
config.consider_all_requests_local = false
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.