From 3e9f3f4e709c9976ab0226fa34f7a4f16b27c061 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 13 Aug 2015 15:00:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=8A=A8=E6=80=81=EF=BC=8C?= =?UTF-8?q?=E6=97=A0=E5=AF=B9=E5=BA=94=E6=95=B0=E6=8D=AE=E6=97=B6=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/courses_helper.rb | 46 ++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 27a973213..ac142f5a1 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -682,28 +682,30 @@ module CoursesHelper # activity = CourseActivity.first title = "" url = "" - case activity.course_act_type - when "Course" - title = activity.course_act.name - url = course_path activity.course - when "HomeworkCommon" - title = "作业 " + activity.course_act.name - url = student_work_index_path(:homework => activity.course_act.id) - when "News" - title = "通知公告 " + activity.course_act.title - url = course_news_index_path(activity.course) - when "Attachment" - title = "课件 " + activity.course_act.filename - url = course_files_path(activity.course) - when "Message" - title = "课程讨论区 " + activity.course_act.subject - url = course_boards_path(activity.course,:parent_id => activity.course_act.parent_id ? activity.course_act.parent_id : activity.course_act.id, :topic_id => activity.course_act.id) - when "JournalsForMessage" - title = "留言 " + activity.course_act.notes - url = course_feedback_path(activity.course) - when "Poll" - title = "问卷 " + activity.course_act.polls_name - url = poll_index_path(:polls_type => "Course", :polls_group_id => activity.course_id) + if activity.course_act + case activity.course_act_type + when "Course" + title = activity.course_act.name + url = course_path activity.course + when "HomeworkCommon" + title = "作业 " + activity.course_act.name + url = student_work_index_path(:homework => activity.course_act.id) + when "News" + title = "通知公告 " + activity.course_act.title + url = course_news_index_path(activity.course) + when "Attachment" + title = "课件 " + activity.course_act.filename + url = course_files_path(activity.course) + when "Message" + title = "课程讨论区 " + activity.course_act.subject + url = course_boards_path(activity.course,:parent_id => activity.course_act.parent_id ? activity.course_act.parent_id : activity.course_act.id, :topic_id => activity.course_act.id) + when "JournalsForMessage" + title = "留言 " + activity.course_act.notes + url = course_feedback_path(activity.course) + when "Poll" + title = "问卷 " + activity.course_act.polls_name + url = poll_index_path(:polls_type => "Course", :polls_group_id => activity.course_id) + end end link_to title.gsub(/<(?!img)[^>]*>/,'').html_safe, url, :class => "problem_tit c_dblue fl fb" end