Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am doing a project in rails, I would like to know How do I check whether I am running in developer mode or production mode in code ?

Thanks

like image 470
Sreeraj Avatar asked Jun 25 '11 08:06

Sreeraj


Video Answer


1 Answers

Rails.env == "production"  Rails.env == "development" 

As mentioned by @xoebus, this is far better:

Rails.env.production?  Rails.env.development? 
like image 149
apneadiving Avatar answered Sep 21 '22 21:09

apneadiving