ruby on rails - sharing constant between models -


i want have constat defined in 2 models, don't want repeat code. i've placed constant in config/application.rb. practice? there better way that?

a better place declare application constants in .rb file in config/initializers folder. declaring constant in initializer (or have done in config/application.rb) makes available in models/controllers/views in application.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -