I want to add configuration used for my own app, seems like the second
you mentioned. I create a file, adding a global variable in it for my
use. Then I include the module when needed. Though it works fine, I
don't think it's a good way when configure items increased. So I think
the ROR must have a predefined file for programmers to config their own
global variables.
I found a folder under rails being named "config", containing two
subfolders("environments","initializers") and several .rb files. I'm
not sure if I can do this in one of them. If configured, can I use the
global variable directly? Or I shall use "require" or "include" in my
code using it.
thanks
on 2010-05-05 05:22
on 2010-06-15 08:16
did get ur mean ..... Wason Wang wrote: > I want to add configuration used for my own app, seems like the second > you mentioned. I create a file, adding a global variable in it for my > use. Then I include the module when needed. Though it works fine, I > don't think it's a good way when configure items increased. So I think > the ROR must have a predefined file for programmers to config their own > global variables. > I found a folder under rails being named "config", containing two > subfolders("environments","initializers") and several .rb files. I'm > not sure if I can do this in one of them. If configured, can I use the > global variable directly? Or I shall use "require" or "include" in my > code using it. > thanks
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.