angular-add-csrf-token

Makes it easy to add csrf-token (authenticity_token) to forms that submit like normal forms. Useful for templates where you can't use erb.


Keywords
angular, form, csrf, token, authenticity_token
License
GPL-3.0+
Install
bower install angular-add-csrf-token

Documentation

angular-add-csrf-token

If you use angular and templates with forms that need csrf tokens, this directive makes it easy to use them without polluting your code.

Install with bower:

bower install angular-add-csrf-token --save

Add to your app.coffee:

#= require angular-add-csrf-token

and to your module's dependencies:

angular.module('your-app', [
  'stefansundin.add-csrf-token'
])

Then add the directive to your form:

<form ... add-csrf-token>

And you're done!