I have an action which gets the id
from user and deletes the item related to; Requests are like this:
/managers/delete_item/5 But this occurs error:
Error: The requested address /managers/delete_item/5 was not found on this server
This is the delete_item
in controller:
function delete_item($id = null)
{
$this->item->id = $id;
$this->item->status = 0;
if ($this->data) {
if ($this->item->save($this->data)) {
$this->Session->setFlash('Removed', 'default', array('class' => 'success-msg'));
$this->redirect(array('controller' => 'managers', 'action' => 'discount'));
} else {
$this->Session->setFlash('ERR', 'default', array('class' => 'error-msg'));
}
} else {
$this->data = $this->item->read();
}
}
However i have some similar actions in my controller which doing such thing Deleting, Editing... and not occurs the error.
Please help.