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