From bc7471bcb7ad52c4486702689a2fa8fb6e3e34fd Mon Sep 17 00:00:00 2001 From: yanxd Date: Mon, 24 Feb 2014 15:00:03 +0800 Subject: [PATCH] course real server host. --- app/controllers/welcome_controller.rb | 2 +- app/views/test/index.html.erb | 3 ++- config/locales/en.yml | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index 64f3002f..1cbea11e 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -19,7 +19,7 @@ class WelcomeController < ApplicationController caches_action :robots def index - (course() and render :course and return 0) if request.headers['REQUEST_URI'].match(/course\.trustie\.net/) + (course() and render :course and return 0) if request.original_url.match(/course\.trustie\.net/) # @news = News.latest User.current # @projects = Project.latest User.current #by young diff --git a/app/views/test/index.html.erb b/app/views/test/index.html.erb index 01c60e1b..d7491db8 100644 --- a/app/views/test/index.html.erb +++ b/app/views/test/index.html.erb @@ -1,3 +1,4 @@

test

-<%= debug @params %> +<%= debug request %> +
\ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index 3d03e33b..b25519d3 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1570,6 +1570,8 @@ en: label_contest_innovate: Competitions label_software_user: Users label_course_practice: Courses + label_course_all: Teacher + label_teacher_all: Student label_user_home: User Space field_hidden_repo: code protected