On Sat, Apr 16, 2011 at 2:34 PM, cricket <zijn.digi...@gmail.com> wrote:
>
> public function add()
> {
>        if (!empty($this->data))
>        {
>                // attempt to save
>        }
>
>        $this->set(
>                'fabricantes',
>                $this->Carro->Fabricante->find('list')
>        );
> }
>
> echo $this->Form->select('Carro.fabricante_id', $fabricantes);
>

One other thing. For find('list') Cake fetches the primary key
(usually id) and the "display field" which defaults to a colmn called
"name". So you'll need to do this in Carro model:

public $displayField = 'nome';

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to