in your controller do the following
public function edit($id = null) {
if (!$id) {
throw new NotFoundException(__('Invalid Edit Id'));
}
$language = $this->Language->find('first', array(
'conditions' => array(
'Language.id' => $id,
),
));
if (empty($language)) {
throw new BadRequestException(__('Invalid Data'));
}
if ($this->request->is('post') || $this->request->is('put')) {
if ($this->Language->save($this->request->data()) {
$this->Session->setFlash(__('saved'));
} else {
$this->Session->setFlash(__('something went wrong'));
}
}
if (empty($this->request->data)) {
$this->request->data = $language;
}
}
public function delete($id = null) {
$this->Language->id = $id;
if (!$this->Language->exists()) {
throw new NotFoundException(__('Invalid Language'));
}
$this->request->onlyAllow('post', 'delete');
if ($this->Language->delete()) {
$this->Session->setFlash(__('Language deleted'));
$this->redirect(array('action' => 'index'));
}
$this->Session->setFlash(__('Language was not deleted'));
$this->redirect(array('action' => 'index'));
}