app/config/routes.php and replace current code with this
Router::connect('/', array('controller' => 'posts', 'action' =>
'index'));
To assign user to post, you have to create user_id field in your post.
You can assign the user_id upon create new post.
Jeremie wrote:
> Hi,
>
> I am new to CakePHP and I am struggling a little bit. I have followed the
> blog tutorial + other similar tuts. Now I want to display the blog posts on
> the home page. Since my Posts controller is already created, can I redirect
> the home page to http://www.domain.com/posts/ ? If not, how should I
> proceed? (if you know a good resource, please share it with me)
>
> Second, I am trying to create some users. No problems with that. It works
> just fine... but how do I assign post to a user? I searched a lot and
> watched a couple of videos but can't find a good tutorial about it. If
> anyone could put me on the right track, it would be great.
>
>
> Thanks!
> Jeremie
--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
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
No comments:
Post a Comment