Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# ======================================
# = Possible Pagination Syntax Options =
# ======================================
# assumes we have Widget::DEFAULT_LIMIT assigned
# 3 is the page number

# Finders

# 1 
Widget.all(:page => 3, :limit => Widget::DEFAULT_LIMIT, :condition => option, ...)

# 2 
Widget.paginate(3, :limit => Widget::DEFAULT_LIMIT, :condition => option,....)

# 3
# Widget.all(:condition => option,....).paginate(3, Widget::DEFAULT_LIMIT)
# ruled out by ssmoot

# 4
Widget.paginate(:page => 3, :limit => Widget::DEFAULT_LIMIT, :conditions => option,....)

#
# Collections or Associations
#

# 1
User.widgets(:page => 3, :limit => Widget::DEFAULT_LIMIT)

# 2
User.widgets.paginate(3, Widget::DEFAULT_LIMIT)