From 0ae4f2f2fa8a6d3098de7816cbb1fbcb45967e19 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 28 Jun 2017 11:01:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E6=8B=9F=E5=AE=9E=E6=88=98=E6=97=B6?= =?UTF-8?q?=E9=80=9A=E8=BF=87=E6=9F=90=E4=B8=80=E5=85=B3=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E7=9B=B4=E6=8E=A5=E5=9C=A8=E5=BD=93=E5=89=8D?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=A2=9E=E5=8A=A0=E6=98=BE=E7=A4=BA=E2=80=9C?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E4=B8=8A=E6=AC=A1=E9=80=9A=E8=BF=87=E7=9A=84?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 2 +- app/views/games/_code_actions.html.erb | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index f9623344b..120387361 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -119,7 +119,7 @@ class GamesController < ApplicationController def file_update @g = Gitlab.client - content = params[:content].strip + content = params[:content].try(:strip) code_file = @g.edit_file(@myshixun.gpid, :content => params[:content], :file_path => @path, :branch_name => @rev, :commit_message => "shixun exec") unless code_file.blank? render :json => {:success => "success"} diff --git a/app/views/games/_code_actions.html.erb b/app/views/games/_code_actions.html.erb index 97f89c4ad..10926f530 100644 --- a/app/views/games/_code_actions.html.erb +++ b/app/views/games/_code_actions.html.erb @@ -1,9 +1,7 @@ -<% if @game.status == 2 %> -