1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Check for jQuery ajax

jQuery slim version doesn't have ajax, so if a person include this version ajaxFilter raises error.
This commit is contained in:
Dmitriy Plekhanov 2017-05-19 22:42:02 +03:00 committed by GitHub
parent c01ea3e549
commit f1a740ef3c

View file

@ -9,7 +9,7 @@
} = Rails
# For backward compatibility
if jQuery? and not jQuery.rails
if jQuery? and jQuery.ajax? and not jQuery.rails
jQuery.rails = Rails
jQuery.ajaxPrefilter (options, originalOptions, xhr) ->
CSRFProtection(xhr) unless options.crossDomain