Scaffolding Help

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Scaffolding Help

sandosh.vasudevan@gmail.com

hey guys!

I'm having problems with table associations.

I have a valley table which looks like this:
CREATE TABLE `valleys` (
  `id` int(11) NOT NULL auto_increment,
  `valley_name` varchar(255) NOT NULL,
  `valley_desc` text NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM


another table with questions like this:
CREATE TABLE `questions` (
  `id` int(11) NOT NULL auto_increment,
  `lang_id` char(4) NOT NULL,
  `question` text NOT NULL,
  `answer` text NOT NULL,
  `valley_id` int(11) NOT NULL,
  PRIMARY KEY  (`id`,`lang_id`,`valley_id`)
) ENGINE=InnoDB

one valley can have many questions so question.php looks like


var $belongsTo = array(
                        'Valley' =>
                            array('className'   => 'Valley',
                                'conditions'    => '',
                                'order'         => '',
                                'foreignKey'    => 'valley_id',
                                'counterCache'  => ''
                                )
                        );


and I am trying to do a scaffold on question controller. on
question/add I am not getting a populated list of valleys to choose
from, instead I am just getting a texbox. I also have a displayfield
set in valley.php. do you guys see any problem here?

adv. thanks for any help!
sandosh


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