views:

113

answers:

1

Hello

I have a puzzling issue regarding modules defined in the lib dir

I have two files

#lib/authentication.rb

module Authentication

end


#lib/test_module.rb

module TestModule

end

In my application controller I have

 class ApplicationController < ActionController::Base
     include Authentication
     include TestModule
 end

The Authentication Module loads properly but the TestModule does not

I get "uninitialized constant ApplicationController::TestModule"

I am stumped... anyone?

EDIT: Does anyone know where I could look to debug this?

+1  A: 

Adding require 'lib/test_module' at the top of your ApplicationController file might help

Veger
Tried that one and this is what I gotno such file to load -- lib/test_module (MissingSourceFile)
rube_noob
Are you sure that the file is in the right place?? Since the require statement is unable to find it...
Veger
I was sure that it was in the right place but I double checked again. For some reason the file name was test_module.r?b. This is odd since it displays in TextMate(where I created the file) as .rb. I renamed the file and it worked. Thank you for your time on this, I was so puzzled I needed another set of eyes on it.
rube_noob