Same as Marcelo: Have a look at the view for index action - And a closer look at the area, where links for add-, edit- and delete-action are defined. Is there is something called like .../posts/posts instead of .../posts/ edit ?
On Mar 7, 6:50 pm, brian <bally.z...@gmail.com> wrote: > What do the URLs look like? Paste an example here. > > Also, do you have any routes set up for Posts? You shouldn't > necessarily need any but, if you have created some Post routes, they > may be the source of the problem. > > On Sat, Mar 7, 2009 at 4:19 AM, bilal <bila...@gmail.com> wrote: > > > indeed i am a noob with PHP & Cake, thats why i am having such a silly > > problem, i have the latest stable release > > have followed the example and went over it several times to ensure > > that i am not missing out on something, i can get the index page, > > which looks like this > > > CakePHP: the rapid development php framework > > Blog posts > > Add Post Id Title Action Created > > 1 The title Delete Edit 2009-03-06 07:58:15 > > 2 A title once again Delete Edit 2009-03-06 07:58:16 > > 3 Title strikes back Delete Edit 2009-03-06 07:58:25 > > > (default) 1 query took 0 ms Nr Query Error Affected Num. rows Took > > (ms) > > 1 SELECT `Post`.`id`, `Post`.`title`, `Post`.`body`, `Post`.`created`, > > `Post`.`modified` FROM `posts` AS `Post` WHERE 1 = 1 3 3 0 > > > however ass soon as i click on ANY of the links i get the following > > error (including delete, edit& Ad Post) > > > Missing Method in PostsController > > Error: The action posts is not defined in controller PostsController > > > Error: Create PostsController::posts() in file: app\controllers > > \posts_controller.php. > > > <?php > > class PostsController extends AppController { > > > var $name = 'Posts'; > > > function posts() { > > > } > > > } > > ?> > > Notice: If you want to customize this error message, create app\views > > \errors\missing_action.ctp. > > > here is what my posts_controller.php looks like > > > <?php > > class PostsController extends AppController { > > > function index() { > > $this->set('posts', $this->Post->find('all')); > > } > > > function view($id) { > > $this->Post->id = $id; > > $this->set('posts', $this->Post->read()); > > > } > > > function add() { > > if (!empty($this->data)) { > > if ($this->Post->save($this->data)) { > > $this->flash('Your post has been saved.', > > '/posts'); > > } > > } > > } > > function edit($id = null) { > > $this->Post->id = $id; > > if (empty($this->data)) { > > $this->data = $this->Post->read(); > > } else { > > if ($this->Post->save($this->data)) { > > $this->flash('Your post has been updated.','/posts'); > > } > > } > > } > > > } > > ?> > > > please help! --~--~---------~--~----~------------~-------~--~----~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---