I would like to be able to set a paramter during start up like: ruby script\server -nodename testNode_1 ... and would like to have access to this setting from models and/or controllers. Can someone point me in the right direction to get this working? Regards -- Posted via http://www.ruby-forum.com/.
Homer, ---[ environment.rb ]--- module MyProjectName MY_VAR = ''rockin'' end --- [ in models or controlllers ]--- MyProjectName::MY_VAR Note: You must restart ./script/server if you change variables in environment.rb. They do not auto-reload like most other railities. Hope this helps, Zack On 8/8/06, Homer Simpson <ruby-forum@homerlex.mailshell.com> wrote:> I would like to be able to set a paramter during start up like: > > ruby script\server -nodename testNode_1 > > ... and would like to have access to this setting from models and/or > controllers. > > Can someone point me in the right direction to get this working? > > Regards > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Homer Simpson
2006-Aug-08 14:10 UTC
[Rails] Re: How Create New Parameter set at Start Time?
Thanks for the reply - but how do I grab the value if its passed from the command line? -- Posted via http://www.ruby-forum.com/.