Something that confused the hell out of me, was when I wanted to so some AJAX request, I wanted to use methode
.xhr? in the controller, to see, whether it was an ajax or regular request.
Turns out a request by a form or a link with
remote: true, does not contain the header
X-Requested-With that this method checks for.
So why include a handy method to the request object, if it is not usable with a standard ajax request.
for reference from