Rails - How do I check developer mode or production 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?
精彩评论