Where and how to store app wide settings variables?

Hi all

I’d like to know what’s a good way to store app wide settings variables.
Because for example I have different fields in models that all should be
20 chars long (validates_length_of :maximum => 20). I don’t want to
hard-code that, because in future this could change.

So where should I store such vars? In the environment.rb file in
constants like…?


Or are there better ways or even something like a Rails-specific
construct for such vars?

Thanks for hints. Joshua

I don’t know of a standard for such a construct, but I created a
constants.rb file in the config directory to hold such information. The
environment.rb file loads (require) the constants file. I wanted this
separation because there are settings that are server specific (
environment.rb) and some that are constant (constants.rb) regardless of

Thank you for that suggestion. :slight_smile: