demarches-normaliennes/app/controllers/backoffice/dossiers_controller.rb

26 lines
722 B
Ruby
Raw Normal View History

2015-09-22 15:00:59 +02:00
class Backoffice::DossiersController < ApplicationController
2015-09-22 10:15:12 +02:00
before_action :authenticate_gestionnaire!
2015-08-10 11:05:06 +02:00
def show
2015-09-22 15:00:59 +02:00
@dossier = Dossier.find(params[:id])
2015-08-10 11:05:06 +02:00
@entreprise = @dossier.entreprise.decorate
@etablissement = @dossier.etablissement
@pieces_justificatives = @dossier.pieces_justificatives
2015-08-10 11:05:06 +02:00
@commentaires = @dossier.commentaires.order(created_at: :desc)
@commentaires = @commentaires.all.decorate
2015-09-22 10:15:12 +02:00
@commentaire_email = current_gestionnaire.email
2015-08-10 11:05:06 +02:00
@procedure = @dossier.procedure
2015-08-10 11:05:06 +02:00
@dossier = @dossier.decorate
rescue ActiveRecord::RecordNotFound
2015-08-10 11:05:06 +02:00
redirect_start
end
private
def redirect_start
2015-08-20 16:32:25 +02:00
redirect_to url_for(controller: '/start', action: :error_dossier)
2015-08-10 11:05:06 +02:00
end
end