I have an add form for "userpages". Each user hasMany userpages.
I want a list of the usernames to be in the select list, but I want
the foreign key user_id to be stored in the userpages table.
The hasMany relationship is already set up.
In my controller I have:
$users = $this->Userpage->User->find('list');
$this->set(compact('users'));
Then in my view:
$form-select('User.username', $users);
but a select box with the user_id's is displayed instead.
How can I get the list of usernames to be displayed, and once I have
the usernames in the select do I get the selected username and then
make a query for that user's id and store that as the user_id?
I appreciate all advice.
Thanks,
~Sarah
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---