Module: Pagy::SearchkickExtra::Pagy

Included in:
Pagy
Defined in:
lib/pagy/extras/searchkick.rb

Overview

Additions for the Pagy class

Instance Method Summary collapse

Instance Method Details

#new_from_searchkick(results, vars = {}) ⇒ Object

Create a Pagy object from a Searchkick::Results object



23
24
25
26
27
28
# File 'lib/pagy/extras/searchkick.rb', line 23

def new_from_searchkick(results, vars = {})
  vars[:items] = results.options[:per_page]
  vars[:page]  = results.options[:page]
  vars[:count] = results.total_count
  new(vars)
end