diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2018-07-31 15:26:26 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-31 15:26:26 -0400 |
commit | 1c811cd2feacfc5a919c3a58e12c9b2b70b6c8a1 (patch) | |
tree | 5f0d3781746f6932943fc62489651aff15c68027 | |
parent | e2aaf5c237717296858240b02d4d2f1ade740458 (diff) | |
parent | 9df747c9f018448a08c298b54ccc59e010f7dd0c (diff) | |
download | rails-1c811cd2feacfc5a919c3a58e12c9b2b70b6c8a1.tar.gz rails-1c811cd2feacfc5a919c3a58e12c9b2b70b6c8a1.tar.bz2 rails-1c811cd2feacfc5a919c3a58e12c9b2b70b6c8a1.zip |
Merge pull request #33488 from znz/avoid-to-post-twice
Throw if ujs loaded twice
-rw-r--r-- | actionview/app/assets/javascripts/rails-ujs/start.coffee | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/actionview/app/assets/javascripts/rails-ujs/start.coffee b/actionview/app/assets/javascripts/rails-ujs/start.coffee index 55595ac96f..32a915ac0b 100644 --- a/actionview/app/assets/javascripts/rails-ujs/start.coffee +++ b/actionview/app/assets/javascripts/rails-ujs/start.coffee @@ -9,7 +9,8 @@ } = Rails # For backward compatibility -if jQuery? and jQuery.ajax? and not jQuery.rails +if jQuery? and jQuery.ajax? + throw new Error('If you load both jquery_ujs and rails-ujs, use rails-ujs only.') if jQuery.rails jQuery.rails = Rails jQuery.ajaxPrefilter (options, originalOptions, xhr) -> CSRFProtection(xhr) unless options.crossDomain |