i have a model named test.rb and when i use @tests=Test.new in my controller i get the following error. Can someone temme how can i resolve this? "undefined method `new' for Test:Module"
+3
A:
Looks like test is already the name of a module called Test if would seem that you have naming conflict. Try placing your own model in a module ie
module MyModule
class Test < ActiveRecord::Base
end
end
and then calling it like so
@test = MyModule::Test.new
MonsterMagnet
2009-06-10 07:21:00
it says uninitialized constant TestsController::MyModule
Nave
2009-06-10 07:24:19
thanks.. its working.. :)
Nave
2009-06-10 08:34:53