Rails是否有内置的分页解决方案? [英] Does Rails have a built-in pagination solution?

查看:56
本文介绍了Rails是否有内置的分页解决方案?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到像mislav-will_paginate这样的分页宝石非常流行.是因为Rails没有内置的分页解决方案,还是因为内置的解决方案不是很好?

I've noticed that pagination gems like mislav-will_paginate are quite popular. Is this because Rails does not have a built-in pagination solution or because the built-in solution is not very good?

推荐答案

在Rails 2.0中,ActionController的分页功能已删除,并变成了一个向后兼容的插件,称为"classic_pagination".但是,从我自己寻找分页解决方案的角度来看,共识似乎是使用'classic_pagination'并不是最佳选择.

In Rails 2.0 the pagination ability of ActionController was removed and turned into a plugin for backwards compatibility called 'classic_pagination'. However, from my searches for a pagination solution for myself the consensus seems to be that using 'classic_pagination' is not optimal.

在观看了几个播客并提出了一些建议之后,我选择尝试使用 will_paginate 插件,没回头.它快速,易于使用且维护良好.

After watching a couple of podcasts and after several recommendations I opted to try the will_paginate plugin and haven't looked back. It's fast, easy to use and well-maintained.

我相信,甚至Searchlogic的V2都推荐使用它.

I believe that even V2 of Searchlogic recommends its use.

这篇关于Rails是否有内置的分页解决方案?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆