It’s saying that in evaluating registeredphone.user.txtForename,
registeredphone.user has a nil value. In order to have a value in the
view,
it would have to have been passed in by the controller.
hth,
Bill
----- Original Message -----
From: “Alana” [email protected]
To: [email protected]
Sent: Thursday, April 20, 2006 10:55 AM
Subject: [Rails] nil object when you didn’t expect it
I’m not sure exactly what you’re trying to accomplish, and I’m still
pretty
new to RoR, but I’ll give it a shot. From your ‘edit’ action, it looks
like
you have two tables: User and Registeredphone. It looks, in your
‘list.rhtml’, like what you’re trying to get ready to do is list all the
phones for a particular user. If that’s the case, you need to modify
the
‘list’ action in your controller so that that’s what you’re passing in
to
the view. Right now, you’re passing in the entire list of Registered
phones
and the user and it looks like you’re trying to do the database join
work in
the view. At any rate, without additional info, that’s how I interpret
the
registeredphone.user.txtForename usage.
Is there some reason you can’t just use one table? That could simplify
things for you.
hth,
Bill
----- Original Message -----
From: “Alana” [email protected]
To: [email protected]
Sent: Thursday, April 20, 2006 11:18 AM
Subject: [Rails] Re: nil object when you didn’t expect it