From e543ad1bdf8766b95ac07a49b5463b750dcfb1c5 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 15 Oct 2014 09:23:12 +0800 Subject: [PATCH] =?UTF-8?q?=E9=BE=9A=E4=B9=90=E9=91=AB=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=84=8F=E8=A7=812=EF=BC=9A=E5=B0=86=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E4=B8=ADcontrol.all.first=E6=94=B9=E4=B8=BAcontrol.all?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admin_controller.rb | 8 ++++---- app/controllers/application_controller.rb | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 22538d86c..68178e194 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -217,11 +217,11 @@ class AdminController < ApplicationController if request.get? @contest_page = FirstPage.where("page_type = 'contest'").first @first_page = FirstPage.where("page_type = 'project'").first - @notification = ContestNotification.all.first; + @notification = ContestNotification.first; elsif request.post? @first_page = FirstPage.where("page_type = 'project'").first @contest_page = FirstPage.where("page_type = 'contest'").first - @notification = ContestNotification.all.first; + @notification = ContestNotification.first; @first_page.web_title = params[:web_title] @contest_page.web_title = params[:web_title] @contest_page.title = params[:contest_title] @@ -254,13 +254,13 @@ class AdminController < ApplicationController def web_footer_made if request.get? - @organizer = WebFooterOranizer.all.first + @organizer = WebFooterOranizer.first @first_page = FirstPage.where("page_type = 'project'").first #@notification = ContestNotification.all.first; elsif request.post? @first_page = FirstPage.where("page_type = 'project'").first @first_page.web_title = params[:web_title] - @organizer = WebFooterOranizer.all.first + @organizer = WebFooterOranizer.first if @organizer.nil? @organizer = WebFooterOranizer.new end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 69a3b5e8b..e72bbc491 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -763,7 +763,7 @@ class ApplicationController < ActionController::Base end def find_web_footer - @organize = WebFooterOranizer.all.first - @companys = WebFooterCompany.all + @organizer = WebFooterOrganizer.first + @companies = WebFooterCompany.all end end