demarches-normaliennes/app/controllers/users/recapitulatif_controller.rb

37 lines
820 B
Ruby
Raw Normal View History

2015-09-23 19:20:03 +02:00
class Users::RecapitulatifController < UsersController
2015-08-10 11:05:06 +02:00
def show
@dossier = current_user_dossier
2015-08-10 11:05:06 +02:00
@dossier = @dossier.decorate
@procedure = @dossier.procedure
2015-08-10 11:05:06 +02:00
2015-08-20 16:39:36 +02:00
# mettre dans le modele
2015-08-10 11:05:06 +02:00
@commentaires = @dossier.commentaires.order(created_at: :desc)
2015-08-10 11:05:06 +02:00
@commentaires = @commentaires.all.decorate
#TODO load user email
@commentaire_email = 'user@email'
2015-08-25 10:49:28 +02:00
rescue ActiveRecord::RecordNotFound
flash.alert = t('errors.messages.dossier_not_found')
redirect_to url_for(root_path)
2015-08-10 11:05:06 +02:00
end
def submit
show
@dossier.next_step! 'user', 'submit'
flash.notice = 'Dossier soumis avec succès.'
render 'show'
end
def submit_validate
show
@dossier.next_step! 'user', 'submit_validate'
flash.notice = 'Dossier déposé avec succès.'
render 'show'
end
2015-08-10 11:05:06 +02:00
end