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 [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
-~----------~----~----~----~------~----~------~--~---