Here''s one way
<http://agilewebdevelopment.com/plugins/system_settings>
You can make your own yaml file
yml file might look like this
production:
email_server: smtp.mycompany.com
Then load the configuration file in environment.rb (or in a model, or
something else)
c = YAML::load(File.open(File.dirname(__FILE__) + "/my_config.yml"))
c is now a hash.. so get the values from the hash
server = c[RAILS_ENV]["email_server"]
I''ve got a writup on something like this for email configs.
http://www.bphogan.com/learn/pdf/tableless_contact_form.pdf
There''s also a plugin that lets you do system settings:
http://agilewebdevelopment.com/plugins/system_settings
but I''ve not used that one.
On 12/1/06, Jonathan Dobbie
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:>
>
> I did a quick search and didn''t find anything about this. My
project is
> getting complex enough that it''d be a real pain to move it to
another
> server (which will happen in a year or two) because so many paths are
> hard coded. Are there any good modules for writing config files for
> ruby on rails applications? I''m not strongly attached to any
particular
> format, I just would like a file in /etc/ that will set a lot of
> variables.
>
> Thanks! You''ve all been very helpful
>
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---