开发者

Rails - How do I check developer mode or production mode in code

开发者 https://www.devze.com 2023-03-15 13:49 出处:网络
I am doing a project in rails, I would like to know开发者_Go百科 How do I check whether I am running in developer modeorproduction mode in code ?

I am doing a project in rails, I would like to know开发者_Go百科 How do I check whether I am running in developer mode or production mode in code ?

Thanks


Rails.env == "production"

Rails.env == "development"

As mentioned by @xoebus, this is far better:

Rails.env.production?

Rails.env.development?
0

精彩评论

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