From 4a78c3cbc9e09b1381544aaea2365051dc685d06 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 17 Jul 2019 09:50:00 +0800 Subject: [PATCH] =?UTF-8?q?html=E6=95=88=E6=9E=9C=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E7=9A=84=E5=AE=9E=E8=AE=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 7 +++++++ app/views/users/html_show.html.erb | 1 + 2 files changed, 8 insertions(+) create mode 100644 app/views/users/html_show.html.erb diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 888e212e3..e9fe4ed94 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -51,6 +51,13 @@ class UsersController < ApplicationController :disposition => 'attachment' #inline can open in browser end + def html_show + @contents = File.read("#{params[:path]}") + respond_to do |format| + format.html {render :layout => false} + end + end + # Redo: 消息总数缓存 def get_navigation_info @old_domain = edu_setting('old_edu_host') diff --git a/app/views/users/html_show.html.erb b/app/views/users/html_show.html.erb new file mode 100644 index 000000000..0fb51d1b8 --- /dev/null +++ b/app/views/users/html_show.html.erb @@ -0,0 +1 @@ +<%= @contents.html_safe %> \ No newline at end of file