/**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Story();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['story_title'])) {
         $model->story_title = $_POST['story_title'];
         $model->story_content = $_POST['story_content'];
         $model->product_id = $_POST['product_id'];
         //echo $id; die();
         if ($model->save()) {
             // echo var_dump($model); die();
         } else {
             die(var_dump($model->getErrors()));
         }
         //echo 'not in'; die();
         //				$this->redirect(array('view','id'=>$model->story_id));
     }
     $this->render('create', array('model' => $model, 'productId' => $model->product_id));
 }