I am making an ajax request: Ajax petition.
function ver_detalles_team() {
$(".card").hover(function () {
let team_id = parseInt($(this).find("span:first-child").html());
var carta = this;
console.log("entro al evento hover")
setTimeout(function () {
$.ajax({
method: "POST",
url: "team/" + team_id,
dataType: "html",
timeout: 2000,
error: function (error) {
console.log(error);
},
success: function (res) {
$(carta).append(res);
}
})
}, 4000)
})
}
and the route configured so that my controller can process it:
post 'team/:team_id',to:"teams#detalle_team"
when the "hover" event is executed, it sends the ajax request, but with the url changed to what I am sending, since I get an error in the rails console:
What is due. Thank you