龚乐鑫修改意见2:将系统中control.all.first改为control.all

This commit is contained in:
sw 2014-10-15 09:23:12 +08:00
parent 062a1a4879
commit e543ad1bdf
2 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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