demarches-normaliennes/app/controllers/admin_controller.rb

25 lines
596 B
Ruby
Raw Normal View History

class AdminController < ApplicationController
before_action :authenticate_administrateur!
def index
2015-10-26 15:54:20 +01:00
redirect_to (admin_procedures_path)
end
def retrieve_procedure
id = params[:procedure_id] || params[:id]
@procedure = current_administrateur.procedures.find(id)
rescue ActiveRecord::RecordNotFound
2017-07-13 10:16:55 +02:00
flash.alert = 'Procédure inexistante'
redirect_to admin_procedures_path, status: 404
end
def procedure_locked?
if @procedure.locked?
flash.alert = 'Procédure verrouillée'
redirect_to admin_procedure_path(id: @procedure.id)
end
end
end