app_config
app_config copied to clipboard
Nested YAML
I would love to be able to do something like
development:
ftp:
server:
port:
and then be able to access it like Conf.ftp.server
would make things a lot cleaner and allow groupings of settings.
Did you try doing that? That is one of the primary functions of this plugin. See the README file on the github project page.
If it doesn't work, something is seriously messed up.
The last time I tried it it exploded badly, I have given it another go. I am using Rails 2.3.5 and Ruby 1.8.7
If I try do to something like
common:
ftp:
ip:
port:
username:
password:
And access it with Conf.ftp.username then I get the error (Working from memory here, sorry) that username is not a valid method for ftp (Class Hash).
When I go into the debugger if I look at Conf.ftp it appears to be a hash. If I then do Conf.ftp['username'] then it works fine but naturally the syntax is rather ugly