带有 Subdomain-fu 的嵌套路由
我的应用程序中有一些标准的嵌套路由,我想使用 subdomain-fu gem 实现子域。所以我目前正在这样做:
example.com/stores/name_of_store/products/name_of_product
并且我想这样做:
name_of_store.example.com/products/name_of_product
似乎已经有一些关于 subdomain-fu 灯塔门票中嵌套路由的 subdomain-fu 失败的讨论,但该灯塔项目不再公开,所以我无法审查他们得出的任何结论。
很高兴听到人们谈论您如何使用 subdomain-fu 实现嵌套路由。
谢谢!
I have some standard nested routes in my app, and I want to implement subdomains using the subdomain-fu gem. So I'm currently doing this:
example.com/stores/name_of_store/products/name_of_product
and I want to do this:
name_of_store.example.com/products/name_of_product
There seems to have been some discussion about the failings of subdomain-fu with regard to nested routes in the subdomain-fu lighthouse tickets, but that lighthouse project is no longer public, so I can't review whatever conclusions they reached.
It would be great to hear from people regarding how you've implemented nested routes with subdomain-fu.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您根本不需要嵌套路由来实现这一点。您可以只使用 subdomain_fu (或手动)来查找
current_store
,然后使用基本的ProductsController
将其查找范围限定为商店内的产品:You shouldn't need nested routes at all to accomplish that. You can just use subdomain_fu (or manually) to find the
current_store
, then a basicProductsController
that scopes its finds to products within a store: