Uysim / pagy-cursor

Cursor pagination with pagy for Ruby On Rails
MIT License
126 stars 23 forks source link

Require statement(s) in pagy initializer not documented in README #8

Closed abevoelker closed 4 years ago

abevoelker commented 4 years ago

First, thanks so much for the gem.

One thing you may want to add to the README instructions is adding the necessary require statement(s) to the pagy initializer:

require "pagy_cursor/pagy/extras/cursor"
require "pagy_cursor/pagy/extras/uuid_cursor"

At least, pagy_cursor didn't work for me in my Rails app until I added the first line to config/initializers/pagy.rb. Thanks again.

Uysim commented 4 years ago

@abevoelker We have mention it here since the first place https://github.com/Uysim/pagy-cursor#usage. Am I correct?

abevoelker commented 4 years ago

Not quite. Just doing what the README says:

require "pagy_cursor"

results in this error for me:

undefined method `pagy_cursor' for #<FoosController:0x000055b7076287e8>

This fixed the error:

require "pagy_cursor/pagy/extras/cursor"

Which I found by reading your specs: https://github.com/Uysim/pagy-cursor/blob/13a2503a4249a5a4313aea8ed008ebc6f87452e7/spec/pagy_cursor/cursor_spec.rb#L2

Uysim commented 4 years ago

Thanks @abevoelker now I updated the read me