From 06b2c25f3d263e08df10897d1a22597caa699bfb Mon Sep 17 00:00:00 2001 From: xianbo Date: Mon, 31 Mar 2014 19:26:07 +0800 Subject: [PATCH] fix --- app/controllers/welcome_controller.rb | 6 +++--- app/models/setting.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index 387595e0..7f20abd1 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -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 diff --git a/app/models/setting.rb b/app/models/setting.rb index 583d034d..ef461fb4 100644 --- a/app/models/setting.rb +++ b/app/models/setting.rb @@ -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