开发者

Subdomain routing in rails 3.1 not working any more?

I usually have my admin area on a subdomain with the following routing:

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

  root :to =开发者_StackOverflow社区> 'pages#home'

However this subdomain routing no longer works in rails 3.1, is there something extra I'm missing now?


Found this in the Rails 3.1 release notes:

named url helpers now accept :subdomain and :domain as options

So it makes me think that now you should write your route like this:

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

I haven't tried it yet, so let us know if that works.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜