Your request is correct. However, you made a request via ajax. In other words, you remain on the page while the request is made behind the scenes.
One of the benefits of this type of request is that it does not interfere with the display of your page.
For example on like buttons where this is commonly used, you would not want your user to be redirected to another page when clicking on a link / button. This requisition is made under page.
To achieve what you want it is necessary to add a redirect via javascript after this POST.
Code:
// Redireccion al controller de Oportunidades
$.post(
'<?php echo site_url('C_Evaluacion/ajax_AdministrarOMejoras')?>',
{
IdEvaluacion: id
},function(data){
window.location = '<?php echo site_url('Mejoras/')?>'+data;
});
The data returned from the controller will be the $IdEvaluacion.
remove this from the controller:
Code:
redirect('Mejoras/'.$IdEvaluacion, 'location' );
and add: