Q:

CakePHP model assosciation: View product image

I have a products model, and each product has several images. So Product-hasMany-Image.
Now when I browse some product I am able to see the images that it has but not able to view the images when I list the products in the index.
How should I get the first image from the product to display it in the index?
The only way I can manage to deal with this is to use the Image model inside the Productscontroller but I guess that this is not the best option.
EDIT:
Most of the stuff is just like after baked. By default does the hasMany display when listing all the products?
Model:
class Product extends AppModel {
var $hasMany = array(
    'Image' => array(
        'className' => 'Image',
        'foreignKey' => 'parent_id',
        'dependent'=> false
    ),
);    }

A:

When you have used the bake script, your index action will most likely have this line in it:
$this->Product->recursive = 0;

This will disable all the relations that you've set. Comment/remove this line and you should be able to display the image properly (it should be under $this->data['Product']['Image']).

