Permalink
Browse files

If an ajax request is being sent then

HTTP_ACCEPT must have text/javascript.

Fixes #52
  • Loading branch information...
1 parent ff185db commit b6a3500bfb4b845d2c5e2f81b3c57a62fffd0845 Neeraj Singh committed Nov 24, 2010
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/rails.js
View
@@ -54,6 +54,7 @@ jQuery(function ($) {
dataType: dataType,
type: method.toUpperCase(),
beforeSend: function (xhr) {
+ xhr.setRequestHeader("Accept", "text/javascript");
el.trigger('ajax:loading', xhr);
},
success: function (data, status, xhr) {

0 comments on commit b6a3500

Please sign in to comment.