will_paginate 重定向到根路径
我有一个 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我必须从 Spree gem 的
routes.rb
中删除root :to
才能解决问题。I had to remove the
root :to
from theroutes.rb
of the Spree gem to solve the problem.