【发布时间】:2010-11-30 04:31:12
【问题描述】:
如何在 rails 中获取子域值,有内置方法吗?
例如
test123.example.com
我想要 url 的 test123 部分。
【问题讨论】:
-
你介意使用正则表达式吗?
-
我认为通过提供一种解决方案来查找字符串的子域以及当前 url 会更好地回答这个问题。考虑到这是 google 上搜索“rails get the subdomain of a url”的排名第一的结果
标签: ruby-on-rails