I have the following relationship setting between two models
- The story belongs to StoryType.
- StoryType hasMany Story
I set up a form to select a StoryType for each story using the following code:
echo $this->Form->input('Story.story_type_id', array('tabindex' => 2));
with this code in the controller to populate the list
$this->set('story_types', $this->Story->StoryType->find('list', array ('order' => 'title')));
But he does not fill the selection field with anything. I know that the find () function works because doing debugging inside the controller produces this:
Array ( [1] => First Person [3] => Third Person )
The strange thing is that this is exactly the same code, just requesting other models to fill in the pick lists for things like users and genres, these are just story types that don't work.
Any ideas? Greetings.
source share