Forum: Rails Engines How to add configuration

3307e1d972a66d713351f2deadc626ae?d=identicon&s=25 Wason Wang (anaconda_wly)
on 2010-05-05 05:22
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
6ff87b231eb17726a86e7bf7cef6bda3?d=identicon&s=25 Jyoti Jain (aradhaya)
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
This topic is locked and can not be replied to.