Skip to content

Instantly share code, notes, and snippets.

@lukesaunders
Created June 8, 2011 14:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukesaunders/1014537 to your computer and use it in GitHub Desktop.
Save lukesaunders/1014537 to your computer and use it in GitHub Desktop.
In Rails layout file:
<script>
function authToken(){
return '<%= form_authenticity_token if protect_against_forgery? -%>';
}
</script>
In FileUploader init code:
uploader = new qq.FileUploader({
...
params: { authenticity_token: authToken() }
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment