To get the last 10 records in my rails db, I use:
pictures = Picture.last(10)
How do I get the 10 before these?
pictures = Picture.last(20)
returns 20 results, not just the records from 11-20.
If you want records between 11 and 20 you could do
Picture.limit(10).offset(11)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments