开发者

Rails3: How do I set variables for the app depending on the ENVIRONMENT

If my app has to behave differently according to the ENV state: production, testing or develo开发者_StackOverflow中文版pment, how do I set those variables?

For example, if I am in production i want the variable @subdomains = 2 and if I am in development then @subdomains = 1


Set these in config/environments/production.rb and config/environments/development.rb and then if you're running a server, restart it for the changes to these files to take effect.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜