As Ruby on Rails developers, we tend to add too much code in the same ActiveRecord
model. Very often, this is because we fail to identify new objects. This article presents a concrete tool that helps keep our ActiveRecord
models sizes under control thanks to the serialize method.
FactoryBot
is a gem that enables you to create fake data for your tests. If you work with Ruby on Rails, there are good chances that you worked with the gem on a few projects.
In this article, we’ll learn how to build an infinite scroll pagination system using only a few lines of code. We will create a very simple Rails application and implement the infinite scroll feature in a Stimulus Controller that you can reuse to paginate all the resources of your app. We will do this step by step so let’s begin!