Tuesday, December 1, 2009

scaffolding and displayField

Hi

I have two very simple models

class Author extends AppModel
{
var $name = 'Author';
var $displayField = 'name';
var $hasMany = 'Book';
}

class Book extends AppModel
{
var $name = 'Book';
var $belongsTo = 'Author';
}

and the corresponding controllers with scaffolding

class AuthorsController extends AppController {
var $name = 'Authors';
var $scaffold;
}

class BooksController extends AppController {
var $name = 'Books';
var $scaffold;
}

according to the documentation
http://book.cakephp.org/view/105/Scaffolding I should see the author's
name when listing books instead of his id, while it's not like that...
where am I going wrong, please?

thanks in advance
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: