Another thing I did was to make sure I assigned the foreign key to the
data like this so the todo data has a task_id, but that just creates a
new db row.
$this->data['Todo']['task_id'] = $this->data['Task']['id'];
On Feb 24, 11:37 pm, mscdex <msc...@gmail.com> wrote:
> On Feb 25, 2:21 am, Dhana <sldh...@gmail.com> wrote:
>
> > Here's a snippet of the save code I am calling.
>
> > if($this->Task->saveAll($this->data['Task'])){
> > $this->Session->setFlash('The task has been updated', 'default',
> > array('class' => 'information'));
> > $this->redirect(array('action' => 'show', $id));
>
> > }
>
> I think you may want:
> if($this->Task->saveAll($this->data)){
> instead of:
> if($this->Task->saveAll($this->data['Task'])){
>
> The latter appears to be just providing saveAll with just your Task
> information and thus is excluding your array of Todo items that came
> from the form.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment