will_paginate 重定向到根路径

发布于 2024-11-03 17:53:28 字数 349 浏览 5 评论 0原文

我有一个 Rails 3 应用程序(附加了 Spree 0.40)。

在我的 ProductsController 操作 index 中,我有产品列表和下面的 will_paginate 帮助程序。

问题是助手正在渲染指向 localhost:3000/?page=x 而不是 localhost:3000/products/?page=x

我有 resources :products 在我的路线文件中。

知道是什么导致了这种奇怪的行为吗?

谢谢

I have a rails 3 application (with Spree 0.40 attached).

In my ProductsController, action index, I have the list of products and below will_paginate helper.

The problem is that the helper is rendering links to localhost:3000/?page=x instead of localhost:3000/products/?page=x

I have resources :products in my routes file.

Any idea what is causing this odd behaviour?

Thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

塔塔猫 2024-11-10 17:53:28

我必须从 Spree gem 的 routes.rb 中删除 root :to 才能解决问题。

I had to remove the root :to from the routes.rb of the Spree gem to solve the problem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文