2017-01-24 14:36:43 +01:00
|
|
|
class Admin::MailTemplatesController < AdminController
|
2016-08-31 16:07:11 +02:00
|
|
|
before_action :retrieve_procedure
|
|
|
|
|
|
|
|
def index
|
2017-01-24 10:19:42 +01:00
|
|
|
@mail_templates = @procedure.mail_templates
|
|
|
|
end
|
2016-08-31 16:07:11 +02:00
|
|
|
|
2017-01-24 10:19:42 +01:00
|
|
|
def edit
|
|
|
|
@mail_template = @procedure.mail_templates.find(params[:id])
|
2016-08-31 16:07:11 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def update
|
2017-01-24 14:36:43 +01:00
|
|
|
mail_template = @procedure.mail_templates.find(params[:id])
|
|
|
|
mail_template.update_attributes(update_params)
|
2016-08-31 16:07:11 +02:00
|
|
|
|
2017-01-24 14:36:43 +01:00
|
|
|
redirect_to admin_procedure_mail_templates_path
|
2016-08-31 16:07:11 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def update_params
|
|
|
|
params.require(:mail_received).permit(:body, :object)
|
|
|
|
end
|
2017-01-24 10:19:42 +01:00
|
|
|
end
|