This is for a blog with posts and comments.

On /posts/view/blog_post_name, I have the blog post, its comments, and
an add comment form. Right now, the add comment form submits to the
same controller function used for this view (/posts/view). The data is
saved using /posts/view and then you are redirected back to the same
view with the blog post (/posts/view/blog_post_name).

It works, but it seems like using the /posts/view function to save
data isn't good practice.

So, I want to have the form either submit to /posts/addcomment or
even /comments/add. The problem is that if I do this, I can't figure
out how to get back to the /posts/view/blog_post_name page and still
have the validation error messages appear (I don't want another view
for /posts/addcomment or /comments/add). I've tried $this->render()
and $this->redirect() and with both the error message don't appear. So
far, it seems like the error messages will only appear in the view
corresponding to the controller function the form is submitted to.

Is my aforementioned working method (using /posts/view to handle
comment saving) bad practice? If so, is there any way I can save the
data in /posts/addcomment or /comments/add and have it return to the /
posts/view/blog_post_name view with the validation error messages
working? For example, can I bind a different view to a particular
controller function?

Thanks.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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