diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index c011d53ec..c5d3082ba 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -52,7 +52,7 @@ class CommentsController < ApplicationController def hidden if current_user.admin_or_business? @discuss = @hack.discusses.where(id: params[:id]).first - @discuss.update_attribute(:hidden, params[:hidden] == "1") + @discuss.update_attribute(:hidden, params[:hidden].to_i == 1) sucess_status else Educoder::TipException(403, "..") diff --git a/app/views/shixuns/get_data_sets.json.jbuilder b/app/views/shixuns/get_data_sets.json.jbuilder index 20ced2acd..82ef309f7 100644 --- a/app/views/shixuns/get_data_sets.json.jbuilder +++ b/app/views/shixuns/get_data_sets.json.jbuilder @@ -5,7 +5,9 @@ json.data_sets do json.author set.author.real_name json.created_on set.created_on json.filesize number_to_human_size(set.filesize) - json.file_path "#{@absolute_folder}/#{set.relative_path_filename}" + # 这里需要去除shixunfiles目录后的标识;因为Jupyter代码里面会写死这样的路径,当实训fork后,这个版本库的路径无法修改,因此给用户展示的 + # 还是/data/shixunfiles/+文件名这种形式 + json.file_path "#{@absolute_folder}/#{set.relative_path_filename}".gsub("/#{@shixun.identifier}", "") end end json.data_sets_count @data_count \ No newline at end of file