I need to set a path depending if I am on my development box of production server. How can I set variables that our dependend on environment? :-) -- John Kopanas john-Iau1QiYlxLpBDgjK7y7TUQ@public.gmane.org http://www.kopanas.com http://www.cusec.net http://www.soen.info --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Tue, Sep 19, 2006 at 07:28:03PM -0400, John Kopanas wrote:> > I need to set a path depending if I am on my development box of > production server. How can I set variables that our dependend on > environment? :-)do you mean something like my_variable = RAILS_ENV == ''test'' ? ''in test mode'' : ''not in test mode'' Jens -- Jens Krämer jk-UayuY8ajoWPk1uMJSBkQmQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
On 9/20/06, Jens Kraemer <jk-UayuY8ajoWPk1uMJSBkQmQ@public.gmane.org> wrote:> > On Tue, Sep 19, 2006 at 07:28:03PM -0400, John Kopanas wrote: > > > > I need to set a path depending if I am on my development box of > > production server. How can I set variables that our dependend on > > environment? :-) > > do you mean something like > my_variable = RAILS_ENV == ''test'' ? ''in test mode'' : ''not in test mode'' > > Jens >You can also define a constant in the .rb files in the environment/ directory. E.g in development.rb: module EnvironmentSpecific Variable="Set for Development" end and in production.rb: module EnvironmentSpecific Variable="Set for Production" end Max --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---