From 6afbed40d8bb100c5f892b006c43a6adfeae6472 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 21 Apr 2017 16:57:59 +0800 Subject: [PATCH] =?UTF-8?q?codemirror=20=E6=AF=8F10=E7=A7=92=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E4=B8=80=E6=AC=A1=EF=BC=9BTIP=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 5 +++- app/views/games/_file_edit_form.html.erb | 32 +++++++++++++++++++++--- app/views/games/_game_results.html.erb | 6 ++--- app/views/games/_repository.html.erb | 1 + app/views/layouts/base_myshixun.html.erb | 2 ++ 5 files changed, 38 insertions(+), 8 deletions(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 35d7aa281..beb32677d 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -94,11 +94,14 @@ class GamesController < ApplicationController @g = Gitlab.client content = params[:content].strip @g.edit_file(@myshixun.gpid, :content => params[:content], :file_path => @path, :branch_name => @rev, :commit_message => "shixun exec") + render :json => {:success => "success"} +=begin respond_to do |format| - format.js{redirect_to entry_myshixun_game_path(@game, :myshixun_id => @myshixun, :path => @path)} + format.js end rescue Exception => e puts e.message +=end end # json调用,显示左边的隐藏具体详情@game 字段 msg diff --git a/app/views/games/_file_edit_form.html.erb b/app/views/games/_file_edit_form.html.erb index 107088eca..8501a6c3f 100644 --- a/app/views/games/_file_edit_form.html.erb +++ b/app/views/games/_file_edit_form.html.erb @@ -1,5 +1,5 @@