[Rails] Re: No Method error

Alana
Mon, 10 Apr 2006 12:51:37 -0000

Hi Ray,

> Tblregisteredphone.tbluser is nil.
>
> You didn''t initialize Tblregisteredphone[tbluser_id].
>
> What does your controller look like?

My tblregisteredphone controller is as follows:

    class Tblregisteredphone < ActiveRecord::Base
	    set_table_name "tblregisteredphones"
	    belongs_to :tbluser,
	       :foreign_key => "intUserID"
	    set_primary_key(:TblRegisteredPhonesID)
    end

"tbluser" has a primary key called "TblUsersID" and the
foreign key in
"tblregisteredphones" is called "intUserID".

Thanks for your help,