Action Delete

i couldn’t delete use action delete on host

show

Error 400

Your request is invalid.

here is my controller

public function actionDelete($id)

{


	$this->loadModel($id)->delete();





	// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser


	if(!isset($_GET['ajax']))


		$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));


}

here is view

$this->menu=array(

array('label'=>'List Places', 'url'=>array('index')),


array('label'=>'Create Places', 'url'=>array('create')),


array('label'=>'Update Places', 'url'=>array('update', 'id'=>$model->id)),


array('label'=>'Delete Places', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')),


array('label'=>'Manage Places', 'url'=>array('admin')),

);

how solve this

Hi

Did you try by get method to do that?

if that is true and you want to delete both GET and POST method you should comment the ‘postOnly + delete’ from filters method


 public function filters() {

        return array(

            'accessControl', // perform access control for CRUD operations

            //'postOnly + delete', // we only allow deletion via POST request

        );

    }

else give us more details