Rails 3 Facebook Authentication - Omniauth-Facebook

In this code -
FB.login(
function(response) {
if (response.authResponse) {
return window.location = ‘/auth/facebook/callback’;
}
}, { scope: ‘email’ }
);

Instead of doing “window.location” here, how it can be done through
ajax?
Please help.