Flowdock
method

env

Importance_3
Ruby on Rails latest stable (v4.1.8) - 2 notes - Class: Rails
env() public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Show source
Register or log in to add new notes.
January 16, 2010 - (>= v2.2.1)
7 thanks

Pretty way to test for current environment

You can check your current Rails environment using nice methods such as:

Rails.env.development?
Rails.env.test?
Rails.env.production?
Rails.env.your_custom_environment?
July 4, 2008
5 thanks

Used to get current Rails environment

Rails#env returns a string representing the current Rails environment.

Code example

>> Rails.env # in development mode
Rails.env
=> "development"