简体   繁体   中英

Rails routes - index page for subdomain and standard url

I am using the account_location plugin in my rails app and have the following route

map.root :controller => "dashboard", :action => 'index'

This route match's on both subdomain.domain.com and www.domain.com

How can I set it up so these two domains match different routes?

Thanks, Andy

This is kind of an indirect answer, but you might want to look into using subdomain_fu . If you use subdomain_fu you'll be able to change that route.

For example:

map.root :controller => "dashboard", :action => 'index', :conditions => { :subdomain => false }

would not match requests with a subdomain.

Here's a great Railscast if you're interested.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM