🔖 Posts about rails

Eliminate N+1 queries and improve Rails app performance with this effective Eager Loading tip

In Rails applications, N+1 queries can cause significant performance issues. They occur when you have a list of items and perform a separate query to retrieve associated data for each item. This can result in poor performance, and even more so if...

A simple way to efficiently calculating and representing average data in Rails

I'm working on a project and I encountered a scenario where I need to calculate the average marks of students and create a simple visualization indicator to represent the calculated average. After a few iterations, I found this can be accomplished through...

Ruby on Rails, The Ultimate Guide to strip, lstip and rstrip Methods

As a Rails developer, I'm often faced with the task of processing and manipulating strings. These useful methods for string manipulation in Ruby are `strip`, `lstrip`, and `rstrip`. In this blog post, we will explore the differences between these methods and how...

A Peek into Crafting Connectroots with Ruby on Rails

Ideas come and go. Yet, a select few manage to take root in our minds, demanding our attention and action. To garner quick feedback, we need reliable tools—those simple to grasp, operate, and seamlessly navigate their ecosystem. A robust community offering support...

Mastering Rails Web Navigation with link_to and button_to Helpers - Part 1

**Note:** This tutorial is divided into two parts. In Part 1 **(you are reading)**, we'll explore the Rails web navigation system, understand how Rails handles requests, and delve deep into the world of middlewares. In [Part 2](https://ahmednadar.com/posts/mastering-rails-web-navigation-with-link_to-and-button_to-helpers-part-2), we'll focus on mastering the...

Mastering Rails Web Navigation with link_to and button_to Helpers - Part 2

Welcome to Part 2 **(you are reading)** of our Rails Web Navigation tutorial! In [Part 1](https://ahmednadar.com/posts/mastering-rails-web-navigation-with-link_to-and-button_to-helpers-part-1), we embarked on a cosmic journey through the Rails galaxy, exploring the intricacies of the Rails web navigation system. We delved deep into how Rails handles...

Simplifying Polymorphic Associations with Rails ActiveRecord::DelegatedType

Hey Rails dev! Ever struggled with handling different types of data in your Rails applications? Well, `ActiveRecord::DelegatedType` is here to make your life easier. In this guide, I'll walk through how you can use `DelegatedType` to manage diverse data relationships in a more organized way. It's...

How I decide to pass on a parameter within a component.

### How I decide to pass on a parameter within a component. Why I chose to explicitly pass the **tag** parameter in **LinkComponent**. When creating a component in Rails, especially when using a component-based architecture like ViewComponent or similar, I was...