Forum: Ruby on Rails accessing models from lib

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Thomas K. (Guest)
on 2006-03-27 04:33
Anyone tried to access the model class from a module in the lib
How should the require line look like?

I have class called A::Folder in app/models/a/folder.rb, and I was
to include it in app/lib/common.rb by adding

  require "a/folder"

But I am getting the following error:

NameError (uninitialized constant Folder):
Rob Greene (Guest)
on 2006-03-27 06:54
(Received via mailing list)
Did you try

   require "models/a/folder"

That's what I've been using for other pieces of my model.
This topic is locked and can not be replied to.