actionpack-per_form_csrf_tokens is a backport of per-form CSRF tokens (introduced in Rails 5) into Rails 4.2.
Note that this gem only adds some patches into
ActionController::Base to "accept" new-format tokens, because it's aimed for enabling Rails 4.2 apps to exchange them with Rails 5.x or higher ones.
Add this line to your application's Gemfile:
And then execute:
You don't need anything other than install.
You should follow the steps below.
- Fork the repository
- Create a feature branch:
git checkout -b add-new-feature
- Commit your changes:
git commit -am 'Add new feature'
- Push the branch:
git push origin add-new-feature
- Send us a pull request
The gem is available as open source under the terms of the MIT License.