Rails 3 非 ActiveRecord 结果的分页

发布于 2024-10-09 12:15:36 字数 382 浏览 0 评论 0原文

我的 Rails 3 应用程序使用 sphinx 对文本文件执行搜索,并在登陆页面视图上返回结果集合:类似

<%= render :partial => "result", :collection => @results %>

Rails 的结果分页方式是什么?我知道有像 will_paginate 这样的插件,但我没有使用 ActiveRecord (我的应用程序甚至不使用数据库)。

Javascript 解决方案是最好的方法吗?我还想在网址中保留 REST,即“/search?query=hello&page=2”

My rails 3 app uses sphinx to perform search on text files, and I return a collection of results on the landing page view: something like

<%= render :partial => "result", :collection => @results %>

What is the Rails way to do pagination for the results? I know there are plugins like will_paginate, but I'm not using ActiveRecord (my app doesn't even use a db).

Is a Javascript solution the best way to go? I want to also maintain REST in the url, ie "/search?query=hello&page=2"

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

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

发布评论

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

评论(1

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