Rails - How to check developer mode or production mode in code

I am doing a project in rails, I would like to know how can I check if I am running in developer mode or production mode in code?

thank

+44
ruby ruby-on-rails ruby-on-rails-3
Jun 25 2018-11-11T00:
source share
1 answer
Rails.env == "production" Rails.env == "development" 

As @xoebus already mentioned, this is much better:

 Rails.env.production? Rails.env.development? 
+85
Jun 25 2018-11-11T00:
source share



All Articles