I've been scouring the manual and this group and the web, and am not
quite understanding what I need to do here, mainly with the naming
convention and such.

I have an organization with chapters and members. Each chapter has a
contact and a treasurer (these can be the same person) that I need to
keep up with. So my Chapters table is set up with contact_id and
treasurer_id both being foreign keys to Members.id.

I set up associations, although they may or may not be correct... in
Chapters, I put:

        var $belongsTo = array(
                        'Contact' => array('className' => 'Member',
                                                                'foreignKey' => 
'contact_id',
                                                                'conditions' => 
'',
                                                                'fields' => '',
                                                                'order' => ''
                        ),
                        'Treasurer' => array('className' => 'Member',
                                                                'foreignKey' => 
'treasurer_id',
                                                                'conditions' => 
'',
                                                                'fields' => '',
                                                                'order' => ''
                        )
        );

When I bake the views, I get a nice drop-down box for the Members view
to select the chapter (Members belongsTo Chapters via the foreign key
chapter_id), but I'm getting regular text boxes for the treasurer and
contact of the chapter, probably because of the naming convention (I
obviously can't call those fields member_id).

So how exactly should I be getting the drop-down box for those two
fields (contact and treasurer)? I assume I need to change some code in
the controller/view, since it's not automagically being produced? Or
is there some way to have Bake automagically recognize those fields
and list the Member name in a drop-down?

Thanks!

-Vera

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to