In my environment.rb file I ‘require’ some files. They seem to be
available to all my .rb files and my application.rhtml, but not to my
other .rhtml files. Is this an understanding error on my part? If not,
what’s the best way of making the files accessible to my .rthml files?
Aren’t the include statements just so that you can merge the namespaces?
Shouldn’t I just be able to do something like: RequiredModule::Constant
to access that constant for the module that was required?
In any case, I have added the “include RequiredModule” in my
caller_helper.rb class, and I still can’t access the constant.
OK - pilot error. Problem is that I had added the constant and not
re-set the server. The server only sources the files once if they’re
done in environment.rb.
Farhad wrote:
Thanks Andrew,
Aren’t the include statements just so that you can merge the namespaces?
Shouldn’t I just be able to do something like: RequiredModule::Constant
to access that constant for the module that was required?
In any case, I have added the “include RequiredModule” in my
caller_helper.rb class, and I still can’t access the constant.