Merge branch 'develop' of 10.0.47.245:/home/trustie2 into develop
This commit is contained in:
commit
301a21b455
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
class WelcomeController < ApplicationController
|
class WelcomeController < ApplicationController
|
||||||
caches_action :robots
|
caches_action :robots
|
||||||
before_filter :entry_select, :entry_select_contest, :only => [:index]
|
before_filter :entry_select_course, :entry_select_contest, :only => [:index]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
# @news = News.latest User.current
|
# @news = News.latest User.current
|
||||||
|
@ -113,13 +113,13 @@ class WelcomeController < ApplicationController
|
||||||
private
|
private
|
||||||
|
|
||||||
# 判断网站的入口,是课程 course 则跳过index去渲染 course 方法
|
# 判断网站的入口,是课程 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/)
|
(course() and render :course and return 0) if request.original_url.match(/course\.trustie\.net/)
|
||||||
end
|
end
|
||||||
|
|
||||||
def entry_select_contest
|
def entry_select_contest
|
||||||
if request.original_url.match(/contest\.trustie\.net/)
|
if request.original_url.match(/contest\.trustie\.net/)
|
||||||
course
|
contest
|
||||||
render :contest, layout: false
|
render :contest, layout: false
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
|
|
@ -163,7 +163,7 @@ class Setting < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
# fixed domain url in development. tantantan's bug
|
# fixed domain url in development. tantantan's bug
|
||||||
if Rails.env.development?
|
if Rails.env.production?
|
||||||
methods.map do |m|
|
methods.map do |m|
|
||||||
define_singleton_method m do; nil; end if m.to_s =~ /([a-zA-Z]+_domain)$/
|
define_singleton_method m do; nil; end if m.to_s =~ /([a-zA-Z]+_domain)$/
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue