Possible Duplicate:
List view for belongs to relation in cake
I have table tha开发者_StackOverflowt has hasMany and belongTo relations. So users table belongs to communes and communes has many users.
Users table has commune_id column and I believe as per cake default you need to have 'name' column in communes table however if you do not want to change this to name. How do you override this and define another column name to act as name so it automatically generates dropdown box in the Users view?
i always thought this is one of the best documented parts of the cookbook. I can only wonder...
$this->displayField = 'your_custom_name';
精彩评论