From 4ce4ef725248a6d5bd285c1edb44ea451df317cf Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 21 Apr 2017 09:25:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=89=88=E6=9C=AC=E5=BA=93?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 4 ++-- app/views/games/_repository.html.erb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index f2744f7f9..a71405f75 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -39,7 +39,7 @@ class GamesController < ApplicationController @content = Base64.decode64(file_content) unless file_content.blank? end if @content.nil? || @type == "root" - @path = @type == "root" ? "" : @path + @path = "" @entries = @repository.entries(@path, @rev) end @@ -65,7 +65,7 @@ class GamesController < ApplicationController # @had_done 1 已通关 (@myshixun.games.count == @game_challenge.position && @game.status ==2) ? @had_done = 1 : @had_done = 0 # 异常结果 - @latest_output = @error_position.try(out_put) + @latest_output = error_position.try(:out_put) # @latest_output = @game.latest_output.try(:expect_output) respond_to do |format| format.html diff --git a/app/views/games/_repository.html.erb b/app/views/games/_repository.html.erb index d5aef2ca3..c2739a980 100644 --- a/app/views/games/_repository.html.erb +++ b/app/views/games/_repository.html.erb @@ -11,7 +11,7 @@
- <% if @content.nil? || @type != "root" %> + <% if !@content.nil? && @type != "root" %>
<%= render :partial => 'games/file_edit_form', :locals => {:filename => @path, :content => @content} %>