Daniyar Baitursynov

Joined

360 Experience
3 Lessons Completed
0 Questions Solved

Activity

Hi, Chris!

Recently found gem from basecamp “geared_pagination”. Can you make a suggestion how to integrate it instead of pagy?

Posted in How to implement cursor based pagination

Hi! I'm new to RoR. Followed Chat Series and want to improve it using infinite scroll. When user reaches top of box I want to load older messages.

Should I use channels to send request for messages to be appended?

GitHub is using cursor pagination in repositories tab. For example: https://github.com/danikarik?after=Y3Vyc29yOnYyOpK5MjAxOS0wNy0xMFQxNzo0OTo0NyswNjowMM4LsayS&tab=repositories

Is it possible to do like that:

  1. In show.html.erb place last_record_id and has_more data attributes.
  2. If has_more is true and scroll in top position, send message to channel
  3. After receiving message from channel append data before current messages.
  4. Update data attributes.

I don't know how to do in best way. Should I extend application_controller or application_record? How to make it reusable?
How to hash cursor like GitHub did.