Something so simple... Was missing exit; in the controller. Looks like it was trying to pull up the address of the id after it was deleted, hence the not found error
Thanks, Dave -----Original Message----- From: brian [mailto:bally.z...@gmail.com] Sent: August-09-09 7:12 PM To: cake-php@googlegroups.com Subject: Re: Works with debug 2 Is the Bookmark deleted? Do you have any code referencing Debugger? In beforeFilter or index action, perhaps? On Sun, Aug 9, 2009 at 5:27 PM, Dave Maharaj :: WidePixels.com<d...@widepixels.com> wrote: > I have this in the controller: > > function delete($id = null) { > if ($this->RequestHandler->isAjax()) { > if ($this->Bookmark->validBookmark($id, > $this->Auth->user('id')) == true) { > $this->Bookmark->del($id); > } else { > $this->redirect(array('controller' => 'users', > 'action' => 'index')); > } > } > } > > and some simple js code to delete the bookmark > > $("a.bookmark").click(function() { > var url_id = $(this).attr('href'); > var x_id = $(this).attr('id').split('_'); > > > $.ajax({ > type: "POST", > url: url_id, > success: function(){ > $('#bookmark_'+ x_id[1]).fadeTo('slow' , 0.0).slideUp('fast', > function() { > $(this).remove(); > }); > } > }); > return false; > }); > > Now when debug is set to 2 it works fine > > Change debug to 0 and inspecting the browser activity i see response > from the server > > <div id="content"> > <h2>Not Found</h2> > <p class="error"> > <strong>Error: </strong> > The requested address > <strong>'/bookmarks/delete/cf0c3ef3937'</strong> was not found on this server.</p> </div> > </div> > Can anyone see something wrong with the code or am I missing something? > > Dave > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---