demarches-normaliennes/app/controllers/backoffice/avis_controller.rb
2017-05-29 11:44:28 +02:00

21 lines
383 B
Ruby

class Backoffice::AvisController < ApplicationController
def create
avis = Avis.new(create_params)
avis.dossier = dossier
avis.save
redirect_to backoffice_dossier_path(dossier)
end
private
def dossier
current_gestionnaire.dossiers.find(params[:dossier_id])
end
def create_params
params.require(:avis).permit(:email, :introduction)
end
end