jeudi 28 mai 2015

Rails Constants using Initializers

I'm not sure what I'm doing wrong. I am written a module in a file: config/initalizers/constants.rb

I have a defined a module with a constant and a static method. It's accessible when called in a view. The problem occurs when I want to call the method from in one of the environment files where I get an unitialized constant error. I believe the initializers are being run after the environment files are being loaded but I am not sure where best to place the method or file.

Any help would be appreciated.

Aucun commentaire:

Enregistrer un commentaire