Dave Smith wrote:> I''m new to this whole thing, so I thought I''d those with
experience.
> What is the best way to store and retrieve application settings? Does
> rails have a mechanism already in place for this... something similar to
> blah.properties in java and application settings in .NET?
You can create constants in environment.rb that have data in them:
MY_SETTINGS = {
:master_user_id => 42,
:foo => "bar"
}
Now anywhere in your app you can:
MY_SETTINGS[:master_user_id] #=> 42
If you want something more flexible and user changeable, check out my
settings plugin:
http://beautifulpixel.com/svn/plugins/settings/
--
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
-~----------~----~----~----~------~----~------~--~---