getting environment?

How do I get the environment my app is running in from with rails?

I want to add a small note in the footer for test.example.com and
stage.example.com environments.

How do I get the environment my app is running in from with rails?

I want to add a small note in the footer for test.example.com and
stage.example.com environments.

RAILS_ENV

There's a new way in edge (or maybe 2.1, don't recall), but I also don't recall the string. Heh.

-philip

How do I get the environment my app is running in from with rails?

I want to add a small note in the footer for test.example.com and
stage.example.com environments.

RAILS_ENV

There's a new way in edge (or maybe 2.1, don't recall), but I also
don't recall the string. Heh.

Typical. I find it right after hitting send :slight_smile:

http://blog.codefront.net/2008/04/06/living-on-the-edge-of-rails-15-the-early-edition/

Quoting...

This has been a long time coming: You can now use Rails.env instead of RAILS_ENV, Rails.root instead of RAILS_ROOT, Rails.logger instead of RAILS_DEFAULT_LOGGER, and Rails.cache instead of RAILS_CACHE. Not having to use constants is nice because it always felt a bit dirty to have so many hard-coded constants in the Rails namespace.