Last active
August 29, 2015 14:06
-
-
Save jhuckabee/810552e99959eacbbea9 to your computer and use it in GitHub Desktop.
rails-ajax.html
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
<polymer-element name="rails-ajax" extends="core-ajax"> | |
<script> | |
Polymer({ | |
ready: function() { | |
this.super(); | |
this.csrfParam = document.querySelector("meta[name=csrf-param]").content; | |
this.csrfToken = document.querySelector("meta[name=csrf-token]").content; | |
}, | |
getParams: function(params) { | |
params = this.super(params); | |
params[this.csrfParam] = this.csrfToken; | |
return params; | |
} | |
}); | |
</script> | |
</polymer-element> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment