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:
parent
c01ea3e549
commit
f1a740ef3c
1 changed files with 1 additions and 1 deletions
|
@ -9,7 +9,7 @@
|
||||||
} = Rails
|
} = Rails
|
||||||
|
|
||||||
# For backward compatibility
|
# For backward compatibility
|
||||||
if jQuery? and not jQuery.rails
|
if jQuery? and jQuery.ajax? and not jQuery.rails
|
||||||
jQuery.rails = Rails
|
jQuery.rails = Rails
|
||||||
jQuery.ajaxPrefilter (options, originalOptions, xhr) ->
|
jQuery.ajaxPrefilter (options, originalOptions, xhr) ->
|
||||||
CSRFProtection(xhr) unless options.crossDomain
|
CSRFProtection(xhr) unless options.crossDomain
|
||||||
|
|
Loading…
Reference in a new issue