I am trying to pass a variable from js to twig in the following way:
<script>
$('.li').on('click', function(){
var that = parseInt($(this).attr("id"));
confirm("Estas seguro?, OK para continuar.",
function(){
document.location = "{{ path('ruta_company',{'id': ' ~ $that ~ '}) }}";
return true;
},
function(){
alert('Operacion Cancelada');
});
});//click
but I can not get the variable conversion.
Any suggestions?