Tutorials

Rails 7.1 adds ActiveRecord::Base::normalizes - BigBinary Blog
Rails 7.1 has introduced a new method in Active Record that can be used to declare normalizations for attribute values. This can be especially useful for sanitizing user input, ensuring consistent formatting, or cleaning up data from external sour...

Five Easy to Miss Performance Fixes for Rails Apps
Improving the performance of a Rails application can be a challenging and time-consuming task. However, there are some config tweaks that are often overlooked but can make a significant difference in response times. In this tutorial, I will focus ...


Algorithms: Two Point Method with Ruby - DEV Community
The Two Point method is a commonly used approach for solving problems in computer science and algorithms. This method involves the use of two pointers, typically referred to as left and right pointers, which are initially positioned at opposite en...

From Theory to Practice: Using Active Storage for File Management in Rails - DEV Community
This is the part B of my Ultimate Guide to Active Storage in Rails series where I aim to teach you all that is required to know about Active Storage. In this part of the series, I aim to walk you through the technical setup of Active Storage and h...

Rails Self-Referential Relationships - DEV Community
In a self-referential relationship a class can interact with itself using a join table. While brainstorming some ideas for my new Rails project I found the topic of self-referential has_many, throughrelationships. After reading about it I decided ...

Sending Better Data With Rails Serializers - DEV Community
Using Ruby on Rails as an API is awesome because of its render :json method. The only problem is that many times the JSON data may contain many unnecessary things. We want more options to customize the data and we can do that using serializers. We...

How To Deploy Your Rails App to a DigitalOcean Droplet Using Dokku - DEV Community
For reference, you can deploy and run about three simple apps on one $6 droplet, but that's only about half the cost of hosting one app on Heroku with a database and caching. Moreover, unlike a Droplet, the Heroku server will sleep when it's not b...

Testing AJAX Controller Requests With Different Versions of Rails and RSpec
AJAX opens a new window (Asynchronous JavaScript and XML) is an approach that combines the use of many different technologies such as HTML or XHTML, CSS, JavaScript, DOM, XML, XSLT, and most importantly the XMLHttpRequest object to provide a bette...

ActionCable and React for Beginners - DEV Community
But sometimes, we want real-time interaction with others. For example, users on Discord or Slack don't manually refresh their applications to get new messages, they are simply received. To facilitate this need for real-time updates, we can use Web...