From 51a783c9a912c52ee1df752261071938f6a0d057 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 16 Sep 2014 15:38:21 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E7=AB=9E=E8=B5=9B=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E9=80=9A=E7=9F=A5=E5=85=AC=E5=91=8A=202.=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E7=AB=9E=E8=B5=9B=E9=A6=96=E9=A1=B5=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=B8=83=E5=B1=80=20=E8=A7=A3=E5=86=B3=E6=96=B9=E6=A1=88?= =?UTF-8?q?=EF=BC=9A=E6=9F=A5=E6=89=BE=E7=B3=BB=E7=BB=9F=E4=B8=AD=E6=9C=80?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E6=9C=80=E5=A4=9A5=E6=9D=A1=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E5=85=AC=E5=91=8A=EF=BC=8C=E6=98=BE=E7=A4=BA=E5=9C=A8?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=EF=BC=8C=E7=94=A8=E6=88=B7=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E7=9B=B8=E5=BA=94=E5=85=AC=E5=91=8A=E8=BF=9B?= =?UTF-8?q?=E5=85=A5=E5=85=AC=E5=91=8A=E8=AF=A6=E7=BB=86=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/welcome_controller.rb | 2 +- app/views/welcome/contest.html.erb | 26 +++++++++++++++----------- config/locales/zh.yml | 2 +- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index ca168ccb8..dee79bc31 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -110,7 +110,7 @@ class WelcomeController < ApplicationController def contest @contest_page = FirstPage.where("page_type = 'contest'").first - @contest_notifications = ContestNotification.order("id desc") + @contest_notifications = Contestnotification.order("created_at desc").limit(5) end def search diff --git a/app/views/welcome/contest.html.erb b/app/views/welcome/contest.html.erb index 251ade0b3..b6fcdf8c9 100644 --- a/app/views/welcome/contest.html.erb +++ b/app/views/welcome/contest.html.erb @@ -166,14 +166,12 @@