demarches-normaliennes/app/controllers/admin/mail_templates_controller.rb

25 lines
529 B
Ruby
Raw Normal View History

class Admin::MailTemplatesController < AdminController
before_action :retrieve_procedure
def index
2017-01-24 10:19:42 +01:00
@mail_templates = @procedure.mail_templates
end
2017-01-24 10:19:42 +01:00
def edit
@mail_template = @procedure.mail_templates.find(params[:id])
end
def update
mail_template = @procedure.mail_templates.find(params[:id])
mail_template.update_attributes(update_params)
redirect_to admin_procedure_mail_templates_path
end
private
def update_params
params.require(:mail_template).permit(:body, :object)
end
2017-01-24 10:19:42 +01:00
end