Flowdock
method

environment

Importance_1
v1.2.6 - Show latest stable - 1 note - Class: Rails::Configuration
environment() public

Return the currently selected environment. By default, it returns the value of the RAILS_ENV constant.

Show source
Register or log in to add new notes.
July 24, 2008 - (v1.0.0 - v2.1.0)
1 thank

Custom environment constants

Custom environment level constants can be passed in to your rails application (server, console, whatever) like this):

# bash, tcsh, whatever shell
GAMEMODE=pregame script/server

Within rails this constant can be accessed by

ENV['GAMEMODE']
=> "pregame"

ENV['DOES-NOT-EXIST']
=> nil