rails if environment development code example
Example 1: rails how to check environment
# from app root run
rails r "puts Rails.env"
Example 2: if rails.env.development
Rails.env.production? #=> true
Rails.env.staging? #=> false
Rails.env.development? #=> false