Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #255 from homakov/patch-1

small fix for CSRF tokens
  • Loading branch information...
commit bb13c9d4035a98249e3a5cfbf135d9c44bd0d87a 2 parents caabad7 + f51fb62
@neerajdotname neerajdotname authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/rails.js
View
7 src/rails.js
@@ -374,4 +374,11 @@
if (this == event.target) rails.enableFormElements($(this));
});
+ $(function(){
+ // making sure that all forms have actual up-to-date token(cached forms contain old one)
+ csrf_token = $('meta[name=csrf-token]').attr('content');
+ csrf_param = $('meta[name=csrf-param]').attr('content');
+ $('form input[name='+csrf_param+']').val(csrf_token);
+ });
+
})( jQuery );
Please sign in to comment.
Something went wrong with that request. Please try again.