将 Paginate 链接范围分页
我正在为我的 Rails3 项目使用 will_paginate 。 我有较小的宽度来显示分页范围链接结果。
我正在显示> 100 条记录,每页 8 条。 因此 will_paginate 链接显示为 1,2,3,4,5,6,7,8,9, .... 14,15 这超出了我的可用宽度。
我想展示的可能是从 1 到 5 然后...最后两页。 ( 1,2,3,4,5, .... 14 ,15 ) Will_Paginate 不接受任何参数来执行此类操作。
有没有人尝试过重写/调整此类方法来这样做? 或者欢迎对具有上述选项的任何其他分页提出建议!
i am using will_paginate for my rails3 project.
i have small width for showing the pagination range links result.
i'm showing > 100 records, 8 per page.
so the will_paginate links appear as 1,2,3,4,5,6,7,8,9, .... 14,15
which goes beyond my available width.
i want to show them may be from 1 to 5 then ... last two pages. ( 1,2,3,4,5, .... 14 ,15 )
Will_Paginate does not take any parameters for doing such thing.
Have anyone tried overriding / tweaking such methods for doing so ??
Or suggestion for any other pagination that has the above options are welcomed!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该能够使用 will_paginate 选项来完成此操作,例如:
请参阅 文档will_paginate的
You should be able to do it using option for will_paginate, something like :
See documention of will_paginate