Infinite Scrolling in Ruby on Rails
For the past three years, I have been working on front-end in Ruby on Rails and every time I attempt something new, I do it in the most organized way possible. At Wolox, we create reusable components or templates to help our future selves with other projects, hence my need for organization.
You’ll have a controller that looks more or less like this:
After doing this, you may imagine what comes next. Yes, we’ll have another method in the controller which will handle only the pagination and will display the games in an HTML that only contains the element list.
HERE is a working example of it, so you can check out how it scrolls. Hope this helps you as much as it helped me.