子域路由到多个控制器问题
我有一个网站:www.mydomain.com,我们的管理控制隐藏在正常客户视图之外。我只想访问子域(例如 admin.mydomain.com)下的管理功能。我可以确保对管理功能的任何请求都必须在子域中具有 admin,但是我如何确保如果管理员单击网站上的其他任何内容(例如指向“mydomain.com/about_company”的链接),他们会得到离开管理主机域,并设置回常规 www.mydomain.com?
根据我对 Rails 路由的理解,子域可以定向到控制器,但我的管理功能被分成多个控制器。有什么想法吗?
谢谢!
I have a site: www.mydomain.com where we have administrative controls hidden away from normal customer view. I would like to only access the administrative features under a subdomain such as admin.mydomain.com. I can ensure that any requests to an administrative feature has to have admin in the subdomain, but how can I make sure that if the admin clicks anything else on the site such as a link to "mydomain.com/about_company" that they would get off of the admin host domain, and gets set back to the regular www.mydomain.com?
From my understanding of rails routing, a subdomain can be directed to a controller, but my administrative features are split into multiple controllers. Any ideas?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 subdomain_fu http://github.com/mbleigh/subdomain-fu 解决此问题。
You can use subdomain_fu http://github.com/mbleigh/subdomain-fu for this matter.