I have a simple question and i'm a beginner in cake php. so, i have a table in my database named "countries". in my view "add.ctp" (a view that add a new "LCC") i have created a dropdown list of countries using my table. the problem is that when i save my new "LCC", cakephp save the id (wich in my case is named "code") of the table countries instead of the name of the table(countries).
in my controller,function add:
$this->loadModel('countries');
$this->set('country', $this->countries->find('list',array('fields'=>array('countries.name','countries.code'))));
in my view add.ctp:
<?php echo $this->Form->input('destination_export', array('label' => '','class'=>'form-control','options'=>$country,'value'=>''));?>
any help will be appreciated.