>> > This is my PostsController::add():
>> >        function add() {
>> >                        if (!empty($this->data)) {
>> >                                $this->data['Posts']['username'] = 
>> > $this->Auth->user
>> > ('username');
>> >                        if  ($this->Post->save($this->data)) {
>> >                                $this->Session->setFlash('Your robot has 
>> > been saved.');
>> >                                $this->redirect(array('action' => 'index'));
>> >                        }
>> >                }
>> >        }
I think you should place
          $this->data['Post']['username'] = $this->Auth->user
after the post->save...

-- 
pietro

--~--~---------~--~----~------------~-------~--~----~
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