Initial commit of foodsoft 2
This commit is contained in:
commit
5b9a7e05df
657 changed files with 70444 additions and 0 deletions
16
vendor/plugins/will_paginate/lib/will_paginate/array.rb
vendored
Normal file
16
vendor/plugins/will_paginate/lib/will_paginate/array.rb
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
require 'will_paginate/collection'
|
||||
|
||||
# http://www.desimcadam.com/archives/8
|
||||
Array.class_eval do
|
||||
def paginate(options = {})
|
||||
raise ArgumentError, "parameter hash expected (got #{options.inspect})" unless Hash === options
|
||||
|
||||
WillPaginate::Collection.create(
|
||||
options[:page] || 1,
|
||||
options[:per_page] || 30,
|
||||
options[:total_entries] || self.length
|
||||
) { |pager|
|
||||
pager.replace self[pager.offset, pager.per_page].to_a
|
||||
}
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue