Re: Database Record deletion problem
What happens if you remove the redirect all together? That way you can see the error message, that's probably obscured with the redirection. Additionally, you may want to look at the manual related to routing - http://book.cakephp.org/view/46/Routes-Configuration Take note in section 3.4.5.5. I don't think this has anything to do with your 'delete' issue... just pointing out that brian is right, you don't want an admins_controller, and this is what I think you are trying to do. -teh On May 22, 5:14 am, lakers fan wrote: > Hello, > > I have a page with list of groups and along with each item there is a > link to delete that group. But deletion is not working.. here is the code > > function deletegroup($id) > { > $this->Group->del($id); > $this->redirect(array('action' =>'groups')); > } > > when I move the mouse over the delete link, i see proper id value.. if i use > the id to delete that record in phpmyadmin, it succeeds.. The Group object is > valid too.. Am i missing anything? > > Thanks, > > Bharani > > _ > Windows Live™: Keep your life in > sync.http://windowslive.com/explore?ocid=TXT_TAGLM_BR_life_in_synch_052009 --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Database Record deletion problem
What happens when you click your link? Does it even redirect somewhere? Throws errors? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Database Record deletion problem
I doubt the name is the problem, though I don't know what it is. I just meant that I've also tried managing everything from an AdminsController but found it very cumbersome. It's much simpler to just delete records from within that model's controller. On Mon, May 25, 2009 at 1:27 AM, lakers fan wrote: > Is it because my controller name is : AdminsController that things are not > working?. Right now addition of records to database works but not deletion. > Will the deletion of records work if I change the controller to say > ManageController?.I just want a controller to add, edit and delete > records from database. > >> Date: Sat, 23 May 2009 13:46:40 -0400 >> Subject: Re: Database Record deletion problem >> From: bally.z...@gmail.com >> To: cake-php@googlegroups.com >> >> >> It looks like you've fallen into the same trap that I have in the >> past: trying to use an AdminsController to do all admin stuff. I found >> that it became a real pain very quickly. I know that, with Cake, it >> can be very confusing to create an "admin section" for your site. >> >> Anyway, I think you're far better off just linking to your >> GroupsController for this, calling admin_delete(). You can still have >> a main admin page, just point links to your other controllers in order >> to list, edit, delete, etc. >> >> On Sat, May 23, 2009 at 2:00 AM, lakers fan wrote: >> > do I need to name my action as delete() right now its called >> > deletegroup(). >> > because in the same admin controller i will deleting groups, users, >> > permissions etc.. The url looks like this: >> > >> > http://localhost/cake/admins/deletegroup/id >> > >> > controller: admins >> > action: deletegroup >> > parameter: id >> > >> > Thanks, >> > Bharani >> > >> >> Date: Fri, 22 May 2009 18:04:01 -0400 >> >> Subject: Re: Database Record deletion problem >> >> From: bally.z...@gmail.com >> >> To: cake-php@googlegroups.com >> >> >> >> >> >> What's the URL in your links? Normally, the action would benamed >> >> delete() or admin_delete(). >> >> >> >> As an aside, you should probably put that code inside an if block: >> >> >> >> if ($this->Group->del($id) >> >> { >> >> $this->redirect(...) >> >> } >> >> >> >> On Fri, May 22, 2009 at 6:14 AM, lakers fan >> >> wrote: >> >> > Hello, >> >> > I have a page with list of groups and along with each item there >> >> > is >> >> > a >> >> > link to delete that group. But deletion is not working.. here is the >> >> > code >> >> > >> >> > function deletegroup($id) >> >> > { >> >> > $this->Group->del($id); >> >> > $this->redirect(array('action' =>'groups')); >> >> > } >> >> > >> >> > when I move the mouse over the delete link, i see proper id value.. >> >> > if i >> >> > use >> >> > the id to delete that record in phpmyadmin, it succeeds.. The Group >> >> > object >> >> > is valid too.. Am i missing anything? >> >> > >> >> > Thanks, >> >> > Bharani >> >> > >> >> > >> >> > Windows Live™: Keep your life in sync. Check it out. >> >> > > >> >> > >> >> >> >> > >> > >> >> > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
RE: Database Record deletion problem
Is it because my controller name is : AdminsController that things are not working?. Right now addition of records to database works but not deletion. Will the deletion of records work if I change the controller to say ManageController?.I just want a controller to add, edit and delete records from database. > Date: Sat, 23 May 2009 13:46:40 -0400 > Subject: Re: Database Record deletion problem > From: bally.z...@gmail.com > To: cake-php@googlegroups.com > > > It looks like you've fallen into the same trap that I have in the > past: trying to use an AdminsController to do all admin stuff. I found > that it became a real pain very quickly. I know that, with Cake, it > can be very confusing to create an "admin section" for your site. > > Anyway, I think you're far better off just linking to your > GroupsController for this, calling admin_delete(). You can still have > a main admin page, just point links to your other controllers in order > to list, edit, delete, etc. > > On Sat, May 23, 2009 at 2:00 AM, lakers fan wrote: > > do I need to name my action as delete() right now its called deletegroup(). > > because in the same admin controller i will deleting groups, users, > > permissions etc.. The url looks like this: > > > > http://localhost/cake/admins/deletegroup/id > > > > controller: admins > > action: deletegroup > > parameter: id > > > > Thanks, > > Bharani > > > >> Date: Fri, 22 May 2009 18:04:01 -0400 > >> Subject: Re: Database Record deletion problem > >> From: bally.z...@gmail.com > >> To: cake-php@googlegroups.com > >> > >> > >> What's the URL in your links? Normally, the action would benamed > >> delete() or admin_delete(). > >> > >> As an aside, you should probably put that code inside an if block: > >> > >> if ($this->Group->del($id) > >> { > >> $this->redirect(...) > >> } > >> > >> On Fri, May 22, 2009 at 6:14 AM, lakers fan wrote: > >> > Hello, > >> > I have a page with list of groups and along with each item there is > >> > a > >> > link to delete that group. But deletion is not working.. here is the > >> > code > >> > > >> > function deletegroup($id) > >> > { > >> > $this->Group->del($id); > >> > $this->redirect(array('action' =>'groups')); > >> > } > >> > > >> > when I move the mouse over the delete link, i see proper id value.. if i > >> > use > >> > the id to delete that record in phpmyadmin, it succeeds.. The Group > >> > object > >> > is valid too.. Am i missing anything? > >> > > >> > Thanks, > >> > Bharani > >> > > >> > > >> > Windows Live™: Keep your life in sync. Check it out. > >> > > > >> > > >> > >> > > > > > > _ Hotmail® goes with you. http://windowslive.com/Tutorial/Hotmail/Mobile?ocid=TXT_TAGLM_WL_HM_Tutorial_Mobile1_052009 --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Database Record deletion problem
It looks like you've fallen into the same trap that I have in the past: trying to use an AdminsController to do all admin stuff. I found that it became a real pain very quickly. I know that, with Cake, it can be very confusing to create an "admin section" for your site. Anyway, I think you're far better off just linking to your GroupsController for this, calling admin_delete(). You can still have a main admin page, just point links to your other controllers in order to list, edit, delete, etc. On Sat, May 23, 2009 at 2:00 AM, lakers fan wrote: > do I need to name my action as delete() right now its called deletegroup(). > because in the same admin controller i will deleting groups, users, > permissions etc.. The url looks like this: > > http://localhost/cake/admins/deletegroup/id > > controller: admins > action: deletegroup > parameter: id > > Thanks, > Bharani > >> Date: Fri, 22 May 2009 18:04:01 -0400 >> Subject: Re: Database Record deletion problem >> From: bally.z...@gmail.com >> To: cake-php@googlegroups.com >> >> >> What's the URL in your links? Normally, the action would benamed >> delete() or admin_delete(). >> >> As an aside, you should probably put that code inside an if block: >> >> if ($this->Group->del($id) >> { >> $this->redirect(...) >> } >> >> On Fri, May 22, 2009 at 6:14 AM, lakers fan wrote: >> > Hello, >> > I have a page with list of groups and along with each item there is >> > a >> > link to delete that group. But deletion is not working.. here is the >> > code >> > >> > function deletegroup($id) >> > { >> > $this->Group->del($id); >> > $this->redirect(array('action' =>'groups')); >> > } >> > >> > when I move the mouse over the delete link, i see proper id value.. if i >> > use >> > the id to delete that record in phpmyadmin, it succeeds.. The Group >> > object >> > is valid too.. Am i missing anything? >> > >> > Thanks, >> > Bharani >> > >> > >> > Windows Live™: Keep your life in sync. Check it out. >> > > >> > >> >> > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
RE: Database Record deletion problem
do I need to name my action as delete() right now its called deletegroup(). because in the same admin controller i will deleting groups, users, permissions etc.. The url looks like this: http://localhost/cake/admins/deletegroup/id controller: admins action: deletegroup parameter: id Thanks, Bharani > Date: Fri, 22 May 2009 18:04:01 -0400 > Subject: Re: Database Record deletion problem > From: bally.z...@gmail.com > To: cake-php@googlegroups.com > > > What's the URL in your links? Normally, the action would benamed > delete() or admin_delete(). > > As an aside, you should probably put that code inside an if block: > > if ($this->Group->del($id) > { > $this->redirect(...) > } > > On Fri, May 22, 2009 at 6:14 AM, lakers fan wrote: > > Hello, > > I have a page with list of groups and along with each item there is a > > link to delete that group. But deletion is not working.. here is the code > > > > function deletegroup($id) > > { > > $this->Group->del($id); > > $this->redirect(array('action' =>'groups')); > > } > > > > when I move the mouse over the delete link, i see proper id value.. if i use > > the id to delete that record in phpmyadmin, it succeeds.. The Group object > > is valid too.. Am i missing anything? > > > > Thanks, > > Bharani > > > > > > Windows Live™: Keep your life in sync. Check it out. > > > > > > > > _ Hotmail® goes with you. http://windowslive.com/Tutorial/Hotmail/Mobile?ocid=TXT_TAGLM_WL_HM_Tutorial_Mobile1_052009 --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Database Record deletion problem
What's the URL in your links? Normally, the action would benamed delete() or admin_delete(). As an aside, you should probably put that code inside an if block: if ($this->Group->del($id) { $this->redirect(...) } On Fri, May 22, 2009 at 6:14 AM, lakers fan wrote: > Hello, > I have a page with list of groups and along with each item there is a > link to delete that group. But deletion is not working.. here is the code > > function deletegroup($id) > { > $this->Group->del($id); > $this->redirect(array('action' =>'groups')); > } > > when I move the mouse over the delete link, i see proper id value.. if i use > the id to delete that record in phpmyadmin, it succeeds.. The Group object > is valid too.. Am i missing anything? > > Thanks, > Bharani > > > Windows Live™: Keep your life in sync. Check it out. > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Database Record deletion problem
Hello, I have a page with list of groups and along with each item there is a link to delete that group. But deletion is not working.. here is the code function deletegroup($id) { $this->Group->del($id); $this->redirect(array('action' =>'groups')); } when I move the mouse over the delete link, i see proper id value.. if i use the id to delete that record in phpmyadmin, it succeeds.. The Group object is valid too.. Am i missing anything? Thanks, Bharani _ Windows Live™: Keep your life in sync. http://windowslive.com/explore?ocid=TXT_TAGLM_BR_life_in_synch_052009 --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---