Skip to content

Instantly share code, notes, and snippets.

@femmestem
femmestem / filter_tracks.rb
Last active August 29, 2015 14:14
Unique Records Persisting Multiple Requests
def filter_tracks
# Does this need to be so high when JavaScript limits display to 14?
@limit ||= 50
# The query methods are responsible for adding their own offsets to this
# hash map; that way, changing or removing a query method doesn't affect any
# other method
# If you need persistence with your implementation of pagination,
# make a session/cookie instead of an instance variable
@tracks_offset ||= {}