I setup associations in my models:
class User extends AppModel {
var $name = 'User';
var $hasMany = array('Post' => array('className' => 'Post'));
}
and
class Post extends AppModel {
var $name = 'Post';
var $belongsTo = array('User' => array('className' => 'User'));
}
Which work great, except in the scaffold, the User dropdown list shows the ID number and not the username. (Username is a column) How do I get it to show the username instead of id?
Add following to your User model: