Type-checking in Ruby 3 using RBS

Ruby 3 has introduced a new syntax language for dynamic typing called RBS. In short, it is a language that we can use to describe the data types used in a Ruby class. We can define the data type of variables and the return type of methods used in a class using RBS. Why do we need type-checking? Since Ruby is a dynamically typed language, we don't need to define the data type of the variables we are using. Ruby automatically assigns a type based on the variable's value at runtime. Let's take the below class as an example. # basic_

Rails 7.1 supports infinite ranges for Active Record Validators

Rails 7.1 supports infinite ranges that can be used with Active Record length and inclusivity validators.

Broadcasting your turbo streams as you want them in Rails 7

A blog about broadcasting turbo streams in Hotwire and solution to some of the common scenarios and issues faced while using them.

Introduction to Ractors in Ruby 3

Ruby 3 has introduced an experimental feature called Ractors. In this article, let's learn more about Ractor with example usage.

Rails 7.1 adds the --parent option to the Job Generator

Rails 7.1 adds the --parent option using which we can create a job that inherits from the superclass. Let's learn how to use it.

Postgres GIN Index in Rails

This article introduces to GIN index in the Postgres database and how to use it in the Rails application.

Implement Passwordless Authentication via Magic Link in Rails API

Authentication is one of the key aspects of many web applications. It is the process of identifying a person before granting them access to the application. It is very important that the authentication approach is secure and easy to use for all users. What is passwordless authentication? Passwordless authentication is a verification process that determines whether an individual is who they claim to be, without coercion. You do not require credentials to log in. All you need is an email address or phone number associated with an account and you will get a magic link or one-time password each time

Everything You Need to know about Serialization in Ruby on Rails - Part III

We had previously talked about the Serialization formats and How Serialization is implemented for storing objects in the relational database in the first two parts of the blog series. This article focuses on the various Serializers that prepare and construct API transferable data in Ruby on Rails.

Rails Parameters Parsing and the Case of Parameters Corruption

Rails is a developer-friendly web application framework that enables developers to do more with less code, but it isn’t always clear exactly what’s going on under the covers. One area where I’ve had a hard time was understanding how Rails parses the Request query parameters and the Form variables. So what's a query parameter? Query parameters are an optional set of key-value pairs that appear after the question mark in the URL. For example, name=contra is a query parameter in https://example.com/over/there?name=contra. And what's a form variable? When we submit a

Rate limiting using Redis in a Rails app

The web is a weird place. You go to sleep thinking that you have a perfectly functional web application and the next day when you wake up, you might find yourself staring at a sudden huge spike in the number of requests. Either your app got popular overnight or you were just a victim of a DOS attack trying to bring your app server down. Usually, it's the latter. There are some popular gems like rack-attack and rack-throttle which work quite well and provides a lot of flexibility. But if you're looking to write your custom logic with minimum dependencies,