demarches-normaliennes/app/controllers/gestionnaires/gestionnaire_controller.rb

23 lines
640 B
Ruby
Raw Normal View History

module Gestionnaires
class GestionnaireController < ApplicationController
before_action :authenticate_gestionnaire!
def nav_bar_profile
:gestionnaire
end
def retrieve_groupe_gestionnaire
id = params[:groupe_gestionnaire_id] || params[:id]
@groupe_gestionnaire = current_gestionnaire.groupe_gestionnaires.find(id)
Sentry.configure_scope do |scope|
scope.set_tags(groupe_gestionnaire: @groupe_gestionnaire.id)
end
rescue ActiveRecord::RecordNotFound
flash.alert = 'Groupe inexistant'
redirect_to gestionnaire_groupe_gestionnaires_path, status: 404
end
end
end