On Mar 10, 4:10 am, pzero <[email protected]> wrote:
> Good Morning together,
>
> I created a blog with Cakephp and now I have two issues. If i edit a
> post instead of updating this post my application create a new post,
You need to include a hidden field in the form for the id.
echo $form->hidden('Post.id');
Substitute your model name for Post if different.
When Cake saves, if the id is present in $data, it will try to update
an existing record in DB.
> and the second issue is by adding a new post. If i write in my title
> and in my comment box text without blanks it works, but if i write for
> example title: "my test" with a blank between my and test i receive
> the message that i must write a title.
You have a validation rule for title that does not allow spaces. Can
you post the $validate array for the model?
> I can't attached my Blog so if someone can help me write me your mail
> adress so that i can send you my blog. I hope someone can help me. I
> have to present this blog at saturday in my shool and I have no idea
> about this two issues
No need to send the entire thing. Just post that one part of your
model. Also, you could post the edit() method from the controller.
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
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