Here is my code:
public function actionPostTest()
{
if(isset($_POST['Test']))
{
$model = new Test();
$model->attributes = $_POST['Test'];
if($model->save())
{
$this->redirect('postTest');
}
}
$this->render('posttest', array('model'=>new Test()));
}
This is saving the data which coming from a form twice to the database.
What is wrong?