Sha256: 5c5c250eaeba6b40029d876be27a4e37ea2b0dc6353b8fdea66b642e478908fd
Contents?: true
Size: 972 Bytes
Versions: 19
Compression:
Stored size: 972 Bytes
Contents
module Sunspot module DSL #:nodoc module Paginatable # Paginate your search. This works the same way as WillPaginate's # paginate(). # # Note that Solr searches are _always_ paginated. Not calling #paginate is # the equivalent of calling: # # paginate(:page => 1, :per_page => Sunspot.config.pagination.default_per_page) # # ==== Options (options) # # :page<Integer,String>:: The requested page. The default is 1. # # :per_page<Integer,String>:: # How many results to return per page. The default is the value in # +Sunspot.config.pagination.default_per_page+ # def paginate(options = {}) page = options.delete(:page) per_page = options.delete(:per_page) raise ArgumentError, "unknown argument #{options.keys.first.inspect} passed to paginate" unless options.empty? @query.paginate(page, per_page) end end end end
Version data entries
19 entries across 19 versions & 7 rubygems