2013-10-25 69 views
1

我正在測試我的rails應用程序在staging服務器staging.example.com在rails應用程序子域的子域

我跟隨了railscast#123。 我在我的應用程序中使用多個子域名。

我想在生產和分期中使用相同的應用程序。

如何避免登臺服務器中的staging.example.com檢測作爲子域的「登臺」,而不是它應該將其視爲域。

,因爲我要測試的網址這樣

  staging    production 
test1.staging.example.com test1.example.com 
test2.staging.example.com test2.example.com 

回答

0
Hi ashwin I ran into different issue but hope the following solution helps you, 

Have you tried changing tld_sizes provided, if not in your environment.rb paste the following code 

SubdomainFu.tld_sizes = { :development => 0, 
          :test => 0, 
          :production => 1 } 

and when you set :test => 0, and check the current subdomain is will give you "test1.staging.example" as your subdomain name and when you set it to 1 it will give you "test1" as your subdomain.