我需要实现一些逻辑,以便在第一页上显示 3 个元素,在所有下一页上显示 1 个元素。对于第一页来说没有问题:
items = @model.limit(@first_page_items)
对于接下来的所有我尝试过的:
@model.offset(@first_page_items).page(@current_page - 1).per(@per) #makes no offset at all - all the items going from the beginning
@model.page(@current_page - 1).per(@per).offset(@first_page_items) #produces 4-th element on the second page and stays on it for ever
我究竟做错了什么?谢谢
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)