Module | ActsAsFerret
In: | lib/acts_as_ferret_will_paginate.rb

### Methods

paginate_search

### Classes and Modules

Module ActsAsFerret::ResultAttributes

### Public Class methods

paginate_search(query, models, options = {})

[Source]

        # File lib/acts_as_ferret_will_paginate.rb, line 2
     2:     def self.paginate_search(query, models, options = {})
     3:       # page, per_page, total = wp_parse_options(options)
     4:       page, per_page, total = options[:page], options[:per_page]
     5:       pager = WillPaginate::Collection.new(page, per_page, total)
     6:       options.merge!(:offset => pager.offset, :limit => per_page)
     7:       result = find(query, models, options)
     8:       returning WillPaginate::Collection.new(page, per_page, result.total_hits) do |pager|
     9:         pager.replace result
    10:       end
    11:     end

[Validate]