Created
August 18, 2019 03:36
-
-
Save MyklClason/71f26ea74ddfcf6c5f51e77582796d50 to your computer and use it in GitHub Desktop.
Rails AJAX call
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Note: Must use `var self = this` to access stuff within the success/error functions | |
Rails.ajax({ | |
url: action_path, | |
type: "PATCH", | |
data: $.param(data), | |
dataType: 'script', | |
processData: false, | |
contentType: false, | |
success: function(data) { }, | |
error: function(data) { } | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment