class ApplicationController < ActionController::Base
- before_action :authenticate_user!
-
- # Ensuring PUNDIT policies and scopes are used
- #after_action :verify_authorized
+ before_action :authenticate_user!
+ before_action :set_layout_variables
+
+ # Ensuring PUNDIT policies and scopes are used
+ #after_action :verify_authorized
- include Pundit
- rescue_from Pundit::NotAuthorizedError, with: :user_not_authorized
+ include Pundit
+ rescue_from Pundit::NotAuthorizedError, with: :user_not_authorized
+
+private
+ def set_layout_variables
+ @title = "openCantine "
+ @version = "v5.0 bêta"
+ end
- private
-
def user_not_authorized
flash[:alert] = "Vous n'êtes pas autorisé.e à effectuer cette action."
redirect_to(request.referrer || root_path)