Hello, I'm a cakePHP noob.  I baked an application and everything is
working fine but I want to create another model relation:

Superuser belongsTo User
User hasMany Superuser

in models/superuser.php:
var $belongsTo = array(
        'ControlledUser' => array(
                'className' => 'User',
                'foreignKey' => 'controlled_userid',
                'conditions' => '',
                'fields' => '',
                'order' => ''
        )
);

in models/user.php:
var $hasMany = array(
        'Superuser2' => array(
                'className' => 'Superuser',
                'foreignKey' => 'controlled_userid',
                'dependent' => false,
                'conditions' => '',
                'fields' => '',
                'order' => '',
                'limit' => '',
                'offset' => '',
                'exclusive' => '',
                'finderQuery' => '',
                'counterQuery' => ''
        )
);

in controllers/superusers_controller.php add()
$controlledUsers = $this->Superuser->ControlledUser->find('list');
$this->set(compact('controlledUsers'));


But when I go to add a superuser, the 'Controlled Userid' is a textbox
instead of a select box.  What am I missing?!

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to