This will work but is conceptually incorrect. You should actaully use something like:
$this->post = $this->Post->find(@$this->params['id'], array('include' => array('comments')));
which will consider the comments model while fetching the posts.
I can't get comments to show, even after putting the $models var in the Post/Blog controller
I tried going through the tutorial with both postgres (my default) and mysql, just to see if it was a problem with the foreign key, but still nothing.
Got the comments showing by replacing
$this->post = $this->Post->find(@$this->params['id']);
with
$this->post = $this->Post->find(@$this->params['id'], array('include' => array('comments')));
in the Post controller (I renamed it Post, though it's actually 'Blog' in the screencast)
That really needs to be in the screencast! Thanks adityamooley :)
1 to 4 of 4