Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    • CommentAuthorpixel-boutique.de
     
    found something confusing in the very helfpul and encouraging screencast.

    if you wonder, why the comment is not shown in the show-view, you need to modify your post-controller.
    You need to include the comment - model also...

    class PostController extends ApplicationController
    {
    var $models = 'post,comment';
    ...


    Hope this helps other people new to Akelos stucking in the screencast :)

    Cheers,
    Chris
    •  
      CommentAuthoradityamooley
     

    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.

    •  
      CommentAuthorwdm
     

    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.

    •  
      CommentAuthorwdm
     

    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 :)