aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2016-01-06 02:55:10 -0200
committerRafael França <rafaelmfranca@gmail.com>2016-01-06 02:55:10 -0200
commitced9612b59d1a8fdd38ac1669cf1e6bd43220a24 (patch)
tree7538e45b68b9d25cd6903cd3eb690a1fc3dfdf43 /railties
parent5c9a0a4a082a474a7bc0a5dabc390eea22a294ea (diff)
parent3e98819e20bc113343d4d4c0df614865ad5a9d3a (diff)
downloadrails-ced9612b59d1a8fdd38ac1669cf1e6bd43220a24.tar.gz
rails-ced9612b59d1a8fdd38ac1669cf1e6bd43220a24.tar.bz2
rails-ced9612b59d1a8fdd38ac1669cf1e6bd43220a24.zip
Merge pull request #22275 from mastahyeti/per-form-csrf
Per-form CSRF tokens
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/generators/rails/app/templates/config/initializers/per_form_csrf_tokens.rb4
-rw-r--r--railties/test/application/configuration_test.rb2
2 files changed, 5 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/config/initializers/per_form_csrf_tokens.rb b/railties/lib/rails/generators/rails/app/templates/config/initializers/per_form_csrf_tokens.rb
new file mode 100644
index 0000000000..1f569dedfd
--- /dev/null
+++ b/railties/lib/rails/generators/rails/app/templates/config/initializers/per_form_csrf_tokens.rb
@@ -0,0 +1,4 @@
+# Be sure to restart your server when you modify this file.
+
+# Enable per-form CSRF tokens.
+Rails.application.config.action_controller.per_form_csrf_tokens = true
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb
index 50d343865c..af3a391cc4 100644
--- a/railties/test/application/configuration_test.rb
+++ b/railties/test/application/configuration_test.rb
@@ -657,7 +657,7 @@ module ApplicationTests
private
- def form_authenticity_token; token; end # stub the authenticy token
+ def form_authenticity_token(*args); token; end # stub the authenticy token
end
RUBY