uninitialized constant problem

Ianne Leson wrote:

I have two models in the modesl directory, say ABC.rb and DEF.rb

ABC.rb: class AbcClass < ActiveRecord::Base ...... hello = Hash.new() hello = DefClass.new #<---here is the error occur ......

DEF.rb: class DefClass < ActiveRecord::Base ...... ....

Do I missing anything important to create the instance?? Thanks

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

Yes, Rails expects the name of the model file to be 'def_class.rb' or 'abc_class.rb'.

_Kevin

Ianne Leson wrote:

_Kevin wrote: > Ianne Leson wrote: >> DEF.rb: >> class DefClass < ActiveRecord::Base >> ...... >> .... >> >> Do I missing anything important to create the instance?? Thanks >> >> -- >> Posted via http://www.ruby-forum.com/. > > Yes, Rails expects the name of the model file to be 'def_class.rb' or > 'abc_class.rb'. > > _Kevin

sorry for my incorrect example, yes, indeed I have followed the rules of "abc_class.rb for AbcClass instance"

Thanks.

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

And what error are you getting?

_Kevin