Namespace question

In my /lib directory, I have:


and inside lives my_class.rb:

module MyModule::MyCode

class MyClass < ActiveRecord::Base

def foo



I would like to be able to access the MyClass class in my controller

I was under the impression this was possible by including the MyModule
module in application.rb but it doesn’t work. The only way I can
access the MyClass class is via which is
a mouthful.

Any ideas??


After including the file,
If you type in:
@foo =

What error do you get? Does it suggest that it doesn’t exist?

Zach I.
→ Blog –
→ Company –
→ Portfolio –

yeah, now matter what I try I get uninitialized constant errors, which
seems so strange. If I use the full path, it’s fine, but mixing in the
module doesn’t give me access to the class.

On 5/25/07, Zach I. // LT3media [email protected] wrote:

e$B"*e(B Portfolio –

a mouthful.

Any ideas??


Rich B.
Senior Developer
Mediagistics, LLC
Tel: (215) 674-4515
Mobile: (267) 640-2195
Email: [email protected]