aboutsummaryrefslogtreecommitdiffstats
path: root/guides/code/getting_started/app/controllers/application_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'guides/code/getting_started/app/controllers/application_controller.rb')
-rw-r--r--guides/code/getting_started/app/controllers/application_controller.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/guides/code/getting_started/app/controllers/application_controller.rb b/guides/code/getting_started/app/controllers/application_controller.rb
index e8065d9505..d83690e1b9 100644
--- a/guides/code/getting_started/app/controllers/application_controller.rb
+++ b/guides/code/getting_started/app/controllers/application_controller.rb
@@ -1,3 +1,5 @@
class ApplicationController < ActionController::Base
- protect_from_forgery
+ # Prevent CSRF attacks by raising an exception.
+ # For APIs, you may want to use :null_session instead.
+ protect_from_forgery with: :exception
end