Does anyone know what the syntax is to determine the current environment (prod, dev, etc.) in code? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
if RAILS_ENV == ''production'' On Jul 23, 2007, at 10:23 AM, blinking bear wrote:> Does anyone know what the syntax is to determine the current > environment (prod, dev, etc.) in code? > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 7/23/07, blinking bear <blinkingbear-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Does anyone know what the syntax is to determine the current environment > (prod, dev, etc.) in code?I really love Coda Hale''s plugin: http://blog.codahale.com/2006/04/09/rails-environments-a-plugin-for-well-rails/ It lets you do Rails.production? and Rails.development? etc. Reads so nicely. -- Chris Wanstrath http://errfree.com // http://errtheblog.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks Chris, hadn''t heard of that one. I actually decided to just use PJ''s Cappin That Stat tip to only include the analytics code when deploying to the production server. - Nathan On 7/23/07, Chris Wanstrath <chris-G5sj8e7vJc8@public.gmane.org> wrote:> > > On 7/23/07, blinking bear < blinkingbear-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Does anyone know what the syntax is to determine the current environment > > > (prod, dev, etc.) in code? > > I really love Coda Hale''s plugin: > http://blog.codahale.com/2006/04/09/rails-environments-a-plugin-for-well-rails/ > > > It lets you do Rails.production? and Rails.development? etc. Reads so > nicely. > > -- > Chris Wanstrath > http://errfree.com // http://errtheblog.com > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---