Something 'required' in environment.rb available to all?

Hi,

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?

Thanks

On 2/13/07, Farhad [email protected] wrote:

Thanks


Posted via http://www.ruby-forum.com/.

Add include statements into your application_helper.rb to give access to
modules/classes that you have required in your environment.rb.


Andrew S.

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.

Andrew S. wrote:

On 2/13/07, Farhad [email protected] wrote:

Thanks


Posted via http://www.ruby-forum.com/.

Add include statements into your application_helper.rb to give access to
modules/classes that you have required in your environment.rb.


Andrew S.

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.

Andrew S. wrote:

On 2/13/07, Farhad [email protected] wrote:

Thanks


Posted via http://www.ruby-forum.com/.

Add include statements into your application_helper.rb to give access to
modules/classes that you have required in your environment.rb.


Andrew S.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs