The failing isn't really in understanding the relationships, just
something odd is happening that I want to get a perspective on as a
beginner.

I have two models with backing database tables.  The models are;

//      app/models/User.php
class User extends AppModel {
        var $name = 'User';
        var $validate = array();
        var $hasMany = array('Post');
}

//      app/models/Post.php
class Post extends AppModel {
        var $name = 'Post';
        var $validate = array();
        var $belongsTo = array('User');
}

I also have two controllers that basically use the scaffold.  The
users controller does what it's supposed to do, but hitting the post
controller doesn't show the user select box, which indicates to me
that the relationship isn't being built. The foreign key in the posts
table is 'user_id'.

As I'm just getting started, I'm at a loss to debug what appears to be
a very basic piece of code.


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