fix
This commit is contained in:
parent
5c63ea2378
commit
06b2c25f3d
|
@ -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
|
||||
|
|
|
@ -163,7 +163,7 @@ class Setting < ActiveRecord::Base
|
|||
end
|
||||
|
||||
# fixed domain url in development. tantantan's bug
|
||||
if Rails.env.development?
|
||||
if Rails.env.production?
|
||||
methods.map do |m|
|
||||
define_singleton_method m do; nil; end if m.to_s =~ /([a-zA-Z]+_domain)$/
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue