2011-09-01 63 views
0

我通常有我的管理區域上,使用下列路由子域:rails 3.1中的子域路由不再工作?

scope :module => "admin", :as => "admin", :constraints => { :subdomain => "admin" } do  
    root :to => 'admin#home' 
    end 

    root :to => 'pages#home' 

但是該子站點的路由不再在軌工作3.1,是有一些額外的,現在我缺少什麼?

回答

1

Rails 3.1 release notes發現這一點:

名爲url傭工現在接受:子域名和:域選項

所以讓我覺得,現在你應該寫你的路線是這樣的:

scope :module => "admin", :as => "admin", :subdomain => "admin" do  
    root :to => 'admin#home' 
end 

我還沒有嘗試過,所以讓我們知道,如果這有效。