路由中的多个子域

时间:2014-06-16 20:13:35

标签: ruby-on-rails heroku ruby-on-rails-4

所以我有:

class MainSite
  def self.matches?(request)
    request.subdomain.blank? || request.subdomain == 'www'
    request.subdomain.blank? || request.subdomain == 'limitless-tor-hello' && 'rocky-depths-buhbye'
  end
end

但路由仅适用于无限且不稳定的..是否可以让它们都工作?我尝试使用&&操作员显然没有工作。

请帮忙!

谢谢!

1 个答案:

答案 0 :(得分:1)

试试这个:

class MainSite
  def self.matches?(request)
    request.subdomain.blank? || request.subdomain == 'www'
    request.subdomain.blank? || 
        request.subdomain == 'limitless-tor-hello' ||
        request.subdomain == 'rocky-depths-buhbye'
  end
end