From 9d23e6a8be9dc6c53b6a6ab68d3a1a1841c1bb82 Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 21 Aug 2014 17:09:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=AB=9E=E8=B5=9B=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E6=A0=87=E9=A2=98=E9=95=BF=E5=BA=A6=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admin_controller.rb | 2 +- app/models/contest_notification.rb | 1 + app/views/welcome/contest.html.erb | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index aac107cfb..c75b9f9bf 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -241,7 +241,7 @@ class AdminController < ApplicationController end else respond_to do |format| - flash.now[:error] = "#{l :label_first_page_create_fail}: #{@first_page.errors.full_messages[0]}\n\t#{@contest_page.errors.full_messages[0]}" + flash.now[:error] = "#{l :label_first_page_create_fail}: #{@first_page.errors.full_messages[0]}\n\t#{@contest_page.errors.full_messages[0]}\n\t#{@notification.errors.full_messages[0]}" format.html { render :action => 'contest_page_made' } diff --git a/app/models/contest_notification.rb b/app/models/contest_notification.rb index c1f2fde6f..d525b4b3a 100644 --- a/app/models/contest_notification.rb +++ b/app/models/contest_notification.rb @@ -1,3 +1,4 @@ class ContestNotification < ActiveRecord::Base attr_accessible :content, :title + validates_length_of :title, maximum: 30 end diff --git a/app/views/welcome/contest.html.erb b/app/views/welcome/contest.html.erb index 8df19a280..30395aa6f 100644 --- a/app/views/welcome/contest.html.erb +++ b/app/views/welcome/contest.html.erb @@ -197,7 +197,7 @@ <%#= link_to l(:label_more_information), forums_path %>
-
<%= @contestNotification.title %>
+
<%= @contestNotification.title %>