From a76b345495fd8b5f8a9a326381471630aaac47f3 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Fri, 29 May 2015 11:40:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E9=A6=96=E9=A1=B5=E4=BC=98?= =?UTF-8?q?=E5=8C=96=20Signed-off-by:=20alan=20<547533434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/welcome/course.html.erb | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb index 9e29dc1ef..476471897 100644 --- a/app/views/welcome/course.html.erb +++ b/app/views/welcome/course.html.erb @@ -140,8 +140,9 @@ <%break if Time.new.strftime("%Y").to_i - year_now >= 2%> <% all_new_hot_course += find_all_new_hot_course(course_count-all_new_hot_course.count, @school_id, year_now, course_term)%> <% end%> - <%= render :partial => 'course_list', :locals => {:course_list => all_new_hot_course} %> - + <% cache all_new_hot_course.max().created_at do %> + <%= render :partial => 'course_list', :locals => {:course_list => all_new_hot_course} %> + <% end %> <% else %> @@ -174,8 +175,9 @@ <%break if Time.new.strftime("%Y").to_i - year_now >= 2%> <% all_new_hot_course += find_all_new_hot_course(9-(all_new_hot_course.count + cur_school_course.count), @school_id, year_now, course_term)%> <% end%> - <%= render :partial => 'course_list', :locals => {:course_list => all_new_hot_course} %> - + <% cache all_new_hot_course.max().created_at do %> + <%= render :partial => 'course_list', :locals => {:course_list => all_new_hot_course} %> + <% end %> <% end %> @@ -192,10 +194,12 @@ <%= link_to "更多>>", forums_path %> - + <% topics = find_new_forum_topics(10) %> + <%# cache topics.maximum(:created_at) do%>