RSSAmplifier

Blog

Ahmed Nadar

Rails, Front-End developer, Indie maker, and building products and Sass for startups. Write articles to help startups and developers with technical content.

ahmednadar.hashnode.devRSS feed ↗20 posts

Latest posts

Turbo streams broadcasting in Rails, update methods

Rails’ turbo streams broadcasts let you update your UI in real time using a range of handy methods. In this series, I’ll break down these methods in pairs—highlighting their similarities and key differences that can significantly impact data consiste...

Implementing Friendly URLs with UUID-Based Models

I want to share a practical solution to a common challenge in Rails development I face it with almost every application I work with: combining UUID-based models with user-friendly URLs. If you've ever wondered how to maintain the security benefits o...

Normalization in Rails 7.1 era

Before Rails 7.1 Once upon a time, way long before the Rails 7.1 era, a smart Rails developer (like yourself) needed to ensure user email addresses were properly normalized (sanitized and formatted correctly). Back then, they used clever techniques s...

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

When creating a component in Rails, especially when using a component-based architecture like ViewComponent or similar, I was faced with a question, how should I pass around and manage data, especially configuration data. Here i have 2 options. Pass...

Your true value beyond the job title

Recently, I was inspired by Coby's reflection on channeling his inner Purple Cow, a concept introduced by Seth Godin. It made me reconsider my self-image and how others perceive me. The idea of "being remarkable, in a way that compels others to talk ...

"Meta or not to Meta" programming in Ruby

In the ever-evolving landscape of Ruby on Rails, how we choose to handle code can be as diverse as the developers themselves. Recently, my exploration into refactoring Rails helper to generate UI component names dynamically, led me down the path of m...

Refactoring Rails Helpers from static to dynamic rendering

Writing code is a journey of continuous improvement, learning, adaptation, and, yes, refactoring. As our applications grow and evolve, we often find ourselves revisiting and rethinking our code to make it more maintainable, scalable, and flexible. To...

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 ...

Composing '99 Bottles of Beer' with Ruby's OOP Harmony'

🌟 Introduction Welcome back 😀! In a previous post, I tackled the classic "99 Bottles of Beer" problem using a procedural approach, leveraging Ruby's case expression to create a straightforward solution. Today, I revisit this catchy tune with a fres...

A Ruby Serenade for 99 Bottles of Beer

Hello, budding Ruby enthusiasts! 🌟 Have you ever heard of the song 99 Bottles of Beer on The Wall? It's the kind of catchy tune that’s perfect for passing time with friends or family as you cruise down the vast stretches of highways in the US or Can...

How Rails inflections work their magic, turning 'UI' into 'Ui'

Years ago, Phil Karlton mentioned once, "that during my dad's time at Netscape, he did indeed throw a quote around, on more than one occasion, it is": There are only two hard things in Computer Science: cache invalidation and naming things In every d...

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, 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 web req...

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 middleware. In Part 2, we'll focus on mastering the lin...

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 of...

The Genesis of Connectroots, A Vision for MENA's Startup Ecosystem

Originally posted on my blog ahmednadar.com Three months ago, I embarked on an exciting journey, the creation of Connectroots. As the days turned into weeks and weeks into months, the pace of progress was exhilarating. Between cycles of design iterat...

Migration Magic ✨, Handling Not-Null Constraints in Production with Ruby on Rails

Originally posted on my blog ahmednadar.com. We've all been there-happily adding new tables and columns to our applications in the development environment. And when things go wrong, we drop the table and start fresh, no harm, no foul 😎. But what hap...

🧹 Tidying Up Your Rails Code: The Art of Refactoring, Marie Kondo Style

originally posted on my blog You know that feeling when you're in the mood to crack on some code and do a 'brain dump' of ideas and code it? I'm sure everyone does, and it's perfectly fine. But sometimes, we forget about the initial brain dump and ca...

🚀 A Unique Partnership: An Entrepreneurial Journey Like No Other 🌟

This is a unique post. It is not about development or design as I like to write, but it is a business collaboration. What is unique here, you might ask? My partner. The post is written by my partner, and every word and emoji. Nothing from me. I know ...

Setup TailwindCSS and esbuild on Rails 7

Every time I run a new rails application, I’d need to configure essential tools for my front-end stacks such as TailwindCSS and esbuild. I’ve adopted my configuration from my friend Pete Hawkins’s post on The best way to run Tailwind CSS on Rails. An...

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 the...