demarches-normaliennes/app/controllers/admin_controller.rb

24 lines
515 B
Ruby
Raw Normal View History

class AdminController < ApplicationController
before_action :authenticate_administrateur!
def index
redirect_to(admin_procedures_path)
end
def retrieve_procedure
id = params[:procedure_id] || params[:id]
@procedure = current_administrateur.procedures.find(id)
rescue ActiveRecord::RecordNotFound
2018-09-05 14:48:42 +02:00
flash.alert = 'Démarche inexistante'
redirect_to admin_procedures_path, status: 404
end
def reset_procedure
if @procedure.brouillon?
@procedure.reset!
end
end
end