summaryrefslogtreecommitdiff
path: root/app/controllers/code_of_honor_controller.rb
diff options
context:
space:
mode:
authorMarius Peter <marius.peter@tutanota.com>2024-12-29 15:14:43 +0100
committerMarius Peter <marius.peter@tutanota.com>2024-12-29 15:14:43 +0100
commitbe2a93525069de2dfa3c23b0c23e7a9f7ad4c03d (patch)
treeb5493e9d35d024ce7be072ec2168b4a98ba0e63f /app/controllers/code_of_honor_controller.rb
First commit.
Diffstat (limited to 'app/controllers/code_of_honor_controller.rb')
-rw-r--r--app/controllers/code_of_honor_controller.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/controllers/code_of_honor_controller.rb b/app/controllers/code_of_honor_controller.rb
new file mode 100644
index 0000000..d0d9044
--- /dev/null
+++ b/app/controllers/code_of_honor_controller.rb
@@ -0,0 +1,12 @@
+class CodeOfHonorController < ApplicationController
+ allow_unauthenticated_access
+
+ def toggle
+ session[:agreed_to_code_of_honor] = !session[:agreed_to_code_of_honor]
+ if session[:agreed_to_code_of_honor]
+ redirect_to root_path, notice: "Vous acceptez le code d'honneur."
+ else
+ redirect_to root_path, alert: "Vous n'acceptez pas le code d'honneur."
+ end
+ end
+end
Copyright 2019--2025 Marius PETER