Rails中的Ajax分页

Below you will see my jquery:

$(function() {
$(".pagination span.page a").click(function (){
    $.get(this.href, null, alert("The pagination link was clicked" + this.href), "script");
    return false;
});


});

I know my call on my classes are working because the alert pops up. I think that it is where I am calling "script" where it is failing because it is not pulling up the page. This is a Rails 3 application that is calling an index.js.erb script. Here is the index.js.erb:

$("#search").html("<%= escape_javascript(render("search")) %>");

Any ideas?

Are you trying to render a partial?

$("#search").html("<%= escape_javascript(render :partial => "search") %>");

When looking on how rails calls ajax I came across a post. It said to do the following:

def index
  format.js
end

Once I called this it started working.