How To Modify Where User Is Redirected After Item Is Deleted

Every time I delete a record, I’m being redirected to the following url:

index.php?r=crew/admin

how do I change it to be:

index.php?r=crew/index

?

The following is my delete button code:


    $this->widget('bootstrap.widgets.TbButton', array(

        'buttonType'=>'link',

        'label'=>'Delete',

        'type'=>'danger',

        'size'=>'medium',

        'htmlOptions'=>array(

            'confirm'=>'are you sure?',

            'submit'=>array('delete', 'id'=>$model->crew_code),

            'returnUrl'=>'crew/index'

            )

    ));

returnUrl isn’t seem to be doing the trick.

The redirection is handled in your delete action, so you should start there. Post the code here if you can.

How the hell did I miss that!? :blink:

Thanks for pointing where to look, it’s good now.

It’s in the Controller actionDelete… i think!