Send this to a friend
1
2
3 WillPaginate::ViewHelpers.pagination_options[:prev_label]=I18n.t("pagination.prev")
4 WillPaginate::ViewHelpers.pagination_options[:next_label]=I18n.t("pagination.next")
5
6
7
8
9
WillPaginate::ViewHelpers.pagination_options[:prev_label]=I18n.t("pagination.prev")
WillPaginate::ViewHelpers.pagination_options[:next_label]=I18n.t("pagination.next")
Send this to a friend
returns “Displaying records 1 – 10 of 35”. used in codestacker
1
2
3 def self.per_page
4 10
5 end
6
7
8
9 def paginate_range(in_collection, in_tot_count)
10 endnumber = in_collection.offset + in_collection.per_page > in_tot_count ?
11 in_tot_count : in_collection.offset + in_collection.per_page
12 "Displaying records #{in_collection.offset + 1} - #{endnumber} of #{in_tot_count}"
13 end
14
15
16
17 @codes = Code.paginate :conditions => conditions, :page => params[:page]
18 @codes_count = Code.count
19
20
21
22 <%= paginate_range @codes, @codes_count %>
def self.per_page
10
end
def paginate_range(in_collection, in_tot_count)
endnumber = in_collection.offset + in_collection.per_page > in_tot_count ?
in_tot_count : in_collection.offset + in_collection.per_page
"Displaying records #{in_collection.offset + 1} - #{endnumber} of #{in_tot_count}"
end
@codes = Code.paginate :conditions => conditions, :page => params[:page]
@codes_count = Code.count
<%= paginate_range @codes, @codes_count %>