46 lines
938 B
Ruby
46 lines
938 B
Ruby
# -*- encoding : utf-8 -*-
|
|
|
|
class Public::FileTunelDownloadsController < ApplicationController
|
|
layout "public"
|
|
|
|
|
|
|
|
def create
|
|
@file_tunel_download = FileTunelDownload.new(params.require(:file_tunel_download).permit!)
|
|
@file_tunel_send = @file_tunel_download.file_tunel_send
|
|
|
|
|
|
|
|
if @file_tunel_download.save
|
|
@file_tunel_download.send_mail_type("envoi_fichier")
|
|
|
|
|
|
redirect_to thank_public_file_tunel_download_path(@file_tunel_download.token)
|
|
|
|
|
|
|
|
else
|
|
render :template => "public/file_tunel_sends/show"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
def thank
|
|
@file_tunel_download = FileTunelDownload.where(:token => params[:id]).first
|
|
@file_tunel_send = @file_tunel_download.file_tunel_send
|
|
|
|
|
|
end
|
|
|
|
def show
|
|
@file_tunel_download = FileTunelDownload.where(:token => params[:id]).first
|
|
@file_tunel_send = @file_tunel_download.file_tunel_send
|
|
|
|
|
|
end
|
|
|
|
|
|
end
|