[Rails] Re: No Method error

Ray Baxter
Mon, 10 Apr 2006 12:59:59 -0000

Alana wrote:
> 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".

That''s your model. We need to see your controller, and probably your
data too.

--

Ray