public function actionUpdate($id)
{
$model = new AttributeForm();
if (isset($_POST['AttributeForm'])) {
$model->attributes = $_POST['AttributeForm'];
if ($model->validate()) {
$model->save();
$this->redirect(array('index'));
}
} else {
$model->loadDataFromAttribute($id);
}
$groups = CHtml::listData(AttributeGroupDescription::model()->findAll(), 'attribute_group_id', 'name');
$this->render('create', array('model' => $model, 'groups' => $groups));
}