Ajax response seems to be getting lost
- by Ringo Blancke
I'm using the ddslick jquery dropdown plugin in conjunction with my Rails app.
In view1, I have
$('#challenges_dropdown').ddslick({
<snipped>
onSelected: function (data) {
$.ajax({
url: "/load_data",
type: "GET",
data: {"id": data.selectedData.value}
});
}
});
I.e., I make a call to my controller to load_data. The controller receives this correctly and then at the end, makes a call to render a separate view
render "data"
This view contains a script snippet that needs to run in order to update some elements of my original view. For some reason, this script snippet is just not running.
I'm very confused. When I use a regular link with data-remote="true", then the whole process works perfectly. However, when I make an AJAX call, it fails.
What's going on??
Thanks!
Ringo