public function actionUpdate()
{
$model = $this->loadModel();
if (isset($_POST['ajax']) && $_POST['ajax'] === 'comment-form') {
echo CActiveForm::validate($model);
Yii::app()->end();
}
if (isset($_POST['Comment'])) {
$model->attributes = $_POST['Comment'];
if ($model->save()) {
$this->redirect(array('index'));
}
}
$this->render('update', array('model' => $model));
}