下記のようなコードでupdateAllとsaveは実行できているのですが、
画面が再読みこみされてしまいます。
$this->autoRender = false;と指定はしているのですが、
何か心あたりのある方いらっしゃいますでしょうか。
if ($this->request->is('ajax')) {
$this->request->data['Fav']['user_id'] = $this->Auth->user('id');
if ($this->Post->updateAll(
array('Post.fav' => 'Post.fav + 1'),
array('Post.id' => $id)
)
&& $this->Fav->save($this->request->data)
){
$this->autoLayout = false;
$this->autoRender = false;
$response = array('id' => $id);
$this->header('Content-Type: application/json');
echo json_encode($response);
exit();
}
}
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2015/10/10 14:17