简体   繁体   English

config / environments / development.rb中“consideration_all_requests_local”的用途?

[英]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.

相关问题 找不到config / environments / development.rb命令 - config/environments/development.rb command not found config / environments / development.rb:30:in <top (required)> &#39;:main:Object(NameError)的未定义局部变量或方法`config&#39; - config/environments/development.rb:30:in `<top (required)>': undefined local variable or method `config' for main:Object (NameError) git pull说config / environments / development.rb未提交 - git pull says config/environments/development.rb is not committed 在Rails项目中,我们将所有常量定义放在config / environment.rb中,将更多特定定义放在config / environments / development.rb中? - In a Rails project, we put all constants definition in config/environment.rb and more particular ones in config/environments/development.rb? Rails think_all_requests_local与Rails.env.development是否相对? - Rails consider_all_requests_local vs. if Rails.env.development? 使用 rspec .think_all_requests_local = false 进行测试 - Testing with rspec .consider_all_requests_local = false 为rspec测试rails临时设置Conside_all_requests_local - Setting consider_all_requests_local temporarily for rspec testing rails Rails 3.2.3最终用户错误消息,而不是在开发模式下使用think_all_requests_local = true的开发人员错误消息 - Rails 3.2.3 End user error messages instead of developer error messages in development mode with consider_all_requests_local = true 我修改了/config/environments/development.rb,是否需要重启Apache? - I modified /config/environments/development.rb, do I need to restart Apache? rails生成rspec:install config / environments / development.rb:1:在`<top(required)>':undefined method`configure' - rails generate rspec:install config/environments/development.rb:1:in `<top (required)>': undefined method `configure'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM