From 75504139c93752a9688c798848afdd4819497f40 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 23 Apr 2015 15:25:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=AF=BE=E7=A8=8B=E7=95=99?= =?UTF-8?q?=E8=A8=80=E6=97=B6=E7=95=99=E8=A8=80=E6=95=B0=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/words_controller.rb | 5 +++-- app/views/layouts/base_courses.html.erb | 2 +- app/views/words/destroy.js.erb | 4 +++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb index 680a13963..3d6772ea8 100644 --- a/app/controllers/words_controller.rb +++ b/app/controllers/words_controller.rb @@ -81,9 +81,10 @@ class WordsController < ApplicationController @journal_destroyed = JournalsForMessage.delete_message(params[:object_id]) if @journal_destroyed.jour_type == "Bid" @bid = Bid.find(@journal_destroyed.jour_id) - end - if @bid @jours_count = @bid.journals_for_messages.where('m_parent_id IS NULL').count + elsif @journal_destroyed.jour_type == "Course" + @course = Course.find @journal_destroyed.jour_id + @jours_count = @course.journals_for_messages.where('m_parent_id IS NULL').count end respond_to do |format| format.js diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 6993b6554..2a26ff59f 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -137,7 +137,7 @@