Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用以下方法获得了 10 条记录中的前 2 条记录
News.all.order("published_at desc").limit(2)
我如何获得剩下的 8 条记录?
当然,您跳过这两个并获得剩余的 8 个
News.order("published_at desc").offset(2).limit(8)
(使用 ActiveRecord 3.2.11 测试)