From b318ecf016fb949f068dd08063f274587caf996a Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 22 Dec 2020 13:23:37 +0800 Subject: [PATCH] fix error --- app/controllers/archives_controller.rb | 2 +- app/views/archives/download_file.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/archives_controller.rb b/app/controllers/archives_controller.rb index 180553f..ea40595 100644 --- a/app/controllers/archives_controller.rb +++ b/app/controllers/archives_controller.rb @@ -12,7 +12,7 @@ class ArchivesController < ApplicationController if Dir.glob(serve_path).length != 0 send_file(serve_path, type: "application/octet-stream") else - render :file => "#{Rails.root}/app/views/errors/404.html", :layout => false, :status => :not_found and return + render :file => "#{Rails.root}/app/views/errors/404.html", :layout => false, :status => :not_found, :content_type => 'text/html' and return end end def index diff --git a/app/views/archives/download_file.html.erb b/app/views/archives/download_file.html.erb index d17299b..8e99379 100644 --- a/app/views/archives/download_file.html.erb +++ b/app/views/archives/download_file.html.erb @@ -1,5 +1,5 @@ <% if @ext == 'pdf' %> - <%= render partial: 'viewer' %> + <%= render partial: 'archives/viewer' %> <% else %>