|
|
|
@ -17,7 +17,7 @@
|
|
|
|
|
|
|
|
|
|
class WelcomeController < ApplicationController
|
|
|
|
|
caches_action :robots
|
|
|
|
|
before_filter :entry_select, :entry_select_contest, :only => [:index]
|
|
|
|
|
before_filter :entry_select_course, :entry_select_contest, :only => [:index]
|
|
|
|
|
|
|
|
|
|
def index
|
|
|
|
|
# @news = News.latest User.current
|
|
|
|
@ -113,13 +113,13 @@ class WelcomeController < ApplicationController
|
|
|
|
|
private
|
|
|
|
|
|
|
|
|
|
# 判断网站的入口,是课程 course 则跳过index去渲染 course 方法
|
|
|
|
|
def entry_select
|
|
|
|
|
def entry_select_course
|
|
|
|
|
(course() and render :course and return 0) if request.original_url.match(/course\.trustie\.net/)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def entry_select_contest
|
|
|
|
|
if request.original_url.match(/contest\.trustie\.net/)
|
|
|
|
|
course
|
|
|
|
|
contest
|
|
|
|
|
render :contest, layout: false
|
|
|
|
|
return 0
|
|
|
|
|
end
|
|
|
|
|