[Rails] How Create New Parameter set at Start Time?

Zack Chandler
Tue, 08 Aug 2006 13:57:43 -0000

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
>