diff options
author | Dmytro Vasin <dmytro.vasin@gmail.com> | 2017-04-10 10:05:54 +0300 |
---|---|---|
committer | Vasin Dmitriy <vasindima779@gmail.com> | 2017-04-11 06:56:52 +0300 |
commit | dc8ddea563f34d2dd3032f414493cb211f71d5cd (patch) | |
tree | 94e20722b9342e82fd0b0277fc8c26a05912ea36 /actionview/app/assets | |
parent | 2144e70a86e6403a6298d61862e2e85615cd2a82 (diff) | |
download | rails-dc8ddea563f34d2dd3032f414493cb211f71d5cd.tar.gz rails-dc8ddea563f34d2dd3032f414493cb211f71d5cd.tar.bz2 rails-dc8ddea563f34d2dd3032f414493cb211f71d5cd.zip |
Set current page as default for ajax requests
Diffstat (limited to 'actionview/app/assets')
-rw-r--r-- | actionview/app/assets/javascripts/rails-ujs/utils/ajax.coffee | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/actionview/app/assets/javascripts/rails-ujs/utils/ajax.coffee b/actionview/app/assets/javascripts/rails-ujs/utils/ajax.coffee index 9af515beda..6fabddf65c 100644 --- a/actionview/app/assets/javascripts/rails-ujs/utils/ajax.coffee +++ b/actionview/app/assets/javascripts/rails-ujs/utils/ajax.coffee @@ -29,6 +29,7 @@ Rails.ajax = (options) -> fire(document, 'ajaxStop') # to be compatible with jQuery.ajax prepareOptions = (options) -> + options.url = options.url or location.href options.type = options.type.toUpperCase() # append data to url if it's a GET request if options.type is 'GET' and options.data |