This isn't making ajax call. I guess its the javascript, on the console the request shows as 'html' rather than 'JS'. I have similar javascripts working for other ajax, but dont know what is wrong here.
_list_page.html.erb
<div class="digg_pagination">
<div class="page_info">
<%= page_entries_info @list_page %>
</div>
<%= will_paginate @list_page, :container => true, , :remote => true %>
</div>
JS gets rendered in list_page.js.erb file -
$(".pagination a").click(function() {
$.ajax({
type: "GET",
url: $(this).attr("href")
});
return false;
});
EDIT: Tried jQuery bind, didn't work. For some reason click event is no binding with the element.
$(".pagination a").bind('click', function(event) {
alert('User clicked on "test"'); # Even this isn't working
$.ajax({
type: "GET",
url: $(this).attr("href")
});
return false;
});