How to get the current environement in which app is running

Hi,

From within my rails app code, is it possible to get the current
environment in which it is running? Such as development / production.

Regards,

Fernando P. wrote:

Hi,

From within my rails app code, is it possible to get the current
environment in which it is running? Such as development / production.

Regards,

use <%=RAILS_ENV%>

use <%=RAILS_ENV%>

Thanks! :slight_smile:

or you can do Rails.env.production?

On Sat, Aug 29, 2009 at 2:13 PM, Fernando
Perez[email protected] wrote:

Hi,

From within my rails app code, is it possible to get the current
environment in which it is running? Such as development / production.

ENV[‘RAILS_ENV’]


Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale