首页项目动态讨论区回复无法刷新

This commit is contained in:
cxt 2015-09-29 11:54:43 +08:00
parent e0b8b7195f
commit 7057247700
4 changed files with 34 additions and 18 deletions

View File

@ -50,11 +50,15 @@ class CommentsController < ApplicationController
# # <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD>̬<EFBFBD>ļ<EFBFBD>¼add end
flash[:notice] = l(:label_comment_added)
course_activity = CourseActivity.where("course_act_type='News' and course_act_id =#{@news.id}").first
course_activity.updated_at = Time.now
course_activity.save
if course_activity
course_activity.updated_at = Time.now
course_activity.save
end
user_activity = UserActivity.where("act_type='News' and act_id =#{@news.id}").first
user_activity.updated_at = Time.now
user_activity.save
if user_activity
user_activity.updated_at = Time.now
user_activity.save
end
end
if params[:user_activity_id]

View File

@ -163,11 +163,15 @@ class MessagesController < ApplicationController
# @reply.reply_id = params[:id]
@topic.children << @reply
course_activity = CourseActivity.where("course_act_type='Message' and course_act_id =#{@topic.id}").first
course_activity.updated_at = Time.now
course_activity.save
if course_activity
course_activity.updated_at = Time.now
course_activity.save
end
user_activity = UserActivity.where("act_type='Message' and act_id =#{@topic.id}").first
user_activity.updated_at = Time.now
user_activity.save
if user_activity
user_activity.updated_at = Time.now
user_activity.save
end
#@topic.update_attribute(:updated_on, Time.now)
if !@reply.new_record?
if params[:asset_id]

View File

@ -174,11 +174,15 @@ class StudentWorkController < ApplicationController
if student_work.save
course_activity = CourseActivity.where("course_act_type='HomeworkCommon' and course_act_id =#{@homework.id}").first
course_activity.updated_at = Time.now
course_activity.save
if course_activity
course_activity.updated_at = Time.now
course_activity.save
end
user_activity = UserActivity.where("act_type='HomeworkCommon' and act_id =#{@homework.id}").first
user_activity.updated_at = Time.now
user_activity.save
if user_activity
user_activity.updated_at = Time.now
user_activity.save
end
respond_to do |format|
format.html {
flash[:notice] = l(:notice_successful_create)

View File

@ -55,12 +55,16 @@ class WordsController < ApplicationController
@jfm = add_reply_adapter options
@save_succ = true if @jfm.errors.empty?
if @save_succ
course_activity = CourseActivity.where("course_act_type='JournalsForMessage' and course_act_id =#{parent_id}").first
course_activity.updated_at = Time.now
course_activity.save
user_activity = UserActivity.where("act_type='JournalsForMessage' and act_id =#{parent_id}").first
user_activity.updated_at = Time.now
user_activity.save
course_activity = CourseActivity.where("course_act_type='JournalsForMessage' and course_act_id =#{parent_id}").first
if course_activity
course_activity.updated_at = Time.now
course_activity.save
end
user_activity = UserActivity.where("act_type='JournalsForMessage' and act_id =#{parent_id}").first
if user_activity
user_activity.updated_at = Time.now
user_activity.save
end
end
respond_to do |format|
# format.html {