aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/app/assets/javascripts
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2018-07-31 15:26:26 -0400
committerGitHub <noreply@github.com>2018-07-31 15:26:26 -0400
commit1c811cd2feacfc5a919c3a58e12c9b2b70b6c8a1 (patch)
tree5f0d3781746f6932943fc62489651aff15c68027 /actionview/app/assets/javascripts
parente2aaf5c237717296858240b02d4d2f1ade740458 (diff)
parent9df747c9f018448a08c298b54ccc59e010f7dd0c (diff)
downloadrails-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
Diffstat (limited to 'actionview/app/assets/javascripts')
-rw-r--r--actionview/app/assets/javascripts/rails-ujs/start.coffee3
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