If I understand you correctly, then you are trying to add a new
comment to the task, not to another comment, correct?

Assuming I am correct :) ... use:

$task['Task']['id']

so that you add method will know which task to add the comment to!

This could also be done, without referring to the task in the URL, if
you are only viewing and commenting one task at a time, by tracking
which task is being viewed - in the view method, use:

$this->Session->write('Task.View.Id', $task['Task']['id']);

and then in the comment add method, use:

$currentTaskId = $this->Session->read('Task.View.Id');

to get the task id to which to add the comment!

Hope this helps you on the way,
   John

On May 22, 8:34 am, programguru <[email protected]> wrote:
[snip]
>
> But now I'm facing a new issue. I need to be able to post a comment from the
> Task view page, and I'm trying to work out the url.
>
> Any advice on this one? This is what I have, and it's not working. It's
> defaulting to the Add Task action:
>
> echo $html->link(__('New Comment', true), array('action'=>'add',
> $task['Comment']['comment'])); ?>
[snip]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to