From 3d344ee5028d3cedf709aaf2ddc5028d0d41b20e Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 25 Apr 2017 10:11:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E7=82=B9=E5=87=BB=E5=85=A8?= =?UTF-8?q?=E9=83=A8=E4=BB=BB=E5=8A=A1=E5=8F=B3=E4=BE=A7=E5=BC=B9=E5=87=BA?= =?UTF-8?q?=EF=BC=8C=E7=94=A8=E9=BC=A0=E6=A0=87=E7=82=B9=E5=87=BB=E6=97=81?= =?UTF-8?q?=E8=BE=B9=E5=85=B6=E4=BB=96=E5=8C=BA=E5=9F=9F=EF=BC=8C=E5=BC=B9?= =?UTF-8?q?=E5=87=BA=E5=8E=BB=E8=87=AA=E5=8A=A8=E6=94=B6=E7=BC=A9=EF=BC=8C?= =?UTF-8?q?=E5=8E=BB=E9=99=A4=E7=82=B9=E5=87=BB=E5=85=A8=E9=83=A8=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E7=9A=84=E8=BD=BD=E5=85=A5=E4=B8=AD,=E5=87=8F?= =?UTF-8?q?=E5=B0=91=E5=90=8E=E5=8F=B0=E8=AE=BF=E9=97=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 3 +++ app/views/games/show.html.erb | 19 ++++++++++++++++++- app/views/layouts/base_myshixun.html.erb | 20 +++++++++++++++++++- 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index c03f48a8d..c40e0af95 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -25,6 +25,9 @@ class GamesController < ApplicationController # @praise 判断是否点赞 # @praise 判断是否踩 def show + # 展示全部实训 + @games = @myshixun.games.includes(:challenge) + @games_count = @games.count @game_challenge = @game.challenge (@myshixun.games.count == @game_challenge.position && @game.status ==2) ? @had_done = 1 : @had_done = 0 @praise = PraiseTread.where("praise_tread_object_id=? and praise_tread_object_type=? and user_id=?", @game_challenge.id, @game_challenge.class.to_s, User.current.id).first diff --git a/app/views/games/show.html.erb b/app/views/games/show.html.erb index 1de9e3220..40696988d 100644 --- a/app/views/games/show.html.erb +++ b/app/views/games/show.html.erb @@ -5,13 +5,13 @@ '/editormd/lib/flowchart.min.js','/editormd/lib/jquery.flowchart.min.js','/editormd/editormd.js'%>