[英]In a Rails project, we put all constants definition in config/environment.rb and more particular ones in config/environments/development.rb?
Is that the usual convention? 这是通常的惯例吗? The more general constants in
config/environment.rb
, and more particular ones, such as HOST_NAME
for development mode in config/environments/development.rb
as localhost:3000
, in config/environments/production.rb
as www.mygreatwebsite.com
, and they will automatically get included into the project? config/environment.rb
更一般的常量,以及更具体的常量,例如config/environments/development.rb
开发模式的HOST_NAME
as localhost:3000
, config/environments/production.rb
中的www.mygreatwebsite.com
,他们会自动加入项目吗?
The config files test/production/development.rb are used when the rails application is started in one of these specific environments (test/production/development). 当rails应用程序在其中一个特定环境(测试/生产/开发)中启动时,将使用配置文件test / production / development.rb。 The config.rb is used to define configuration which applies to all environments.
config.rb用于定义适用于所有环境的配置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.