Skip to content
Write Software, Well
  • Services
  • Books
  • LinkedIn
  • Archive
  • About
Sign in Subscribe
Anonymous Block Forwarding in Ruby

Anonymous Block Forwarding in Ruby

In this post, we'll take a look at the anonymous block forwarding feature added in Ruby 3.1. It lets you replace your execute(&block) calls with execute(&). Not only it saves you from coming up with a variable (most likely blk), it also looks pretty sweet. I dig it.

Ruby Gems 2 min read
Custom URL Helpers with the direct Method in Rails Router

Custom URL Helpers in Rails with the direct Method

This is the first post in the Campfire deep dive series where we explore the first ONCE product from 37signals to learn and extract useful patterns, ideas, and best practices. This post explores the direct method in the Rails Router that lets you define custom URL helpers for your application.

Rails Internals 6 min read
Crossroad in the woods to hint Rails Router

Understanding the Rails Router: Why, What, and How

The router is the entry point of your Rails application. It acts as the gatekeeper for all incoming HTTP requests, inspecting and sending them to a controller action; even filtering and rejecting them if necessary. In this article, we’ll do a deep dive into the Rails Router to understand it better.

This article is for Members only

23 min read
__FILE__ in Ruby

What is __FILE__ in Ruby?

You must have come across the mysterious term __FILE__ while reading Ruby code. It's a magic variable that returns the name of the current file. This short post shows a few different use cases that I found while reading the Rails source code.

Ruby Gems 1 min read
Leaking credit card number in log file

Prevent Logging Sensitive Data with Rails Parameter Filters

This article explains why you shouldn't log confidential or user-identifiable information and how to filter it using parameter filtering in Rails. We'll also do a deep dive into the Rails source code to learn exactly how Rails implements parameter filters.

Rails Internals 10 min read
Understanding Rails Environments

💬 Understanding How Rails Environments Work

This post covers the basics of environments in Rails, including what they are, how they work and why they're so important. We'll also take a look behind the scenes and dive into the Rails source code to learn exactly how they're implemented, exploring a few interesting "inquiry" classes in Rails.

Rails Internals 6 min read
Learn to Program in Ruby

Learn to Program Ruby with Me

Any topic, no matter how basic, can be made much more interesting if you dig deep enough, and we can always improve, grow, and extract more out of our education. This post announces a new tutorial on this blog where we'll learn to program in Ruby from the absolute basics. Hope you join me.

Learn to Program 4 min read
How to Process a Turbo Stream Response in JavaScript using Stimulus

How to Process a Turbo Stream Response in JavaScript using Stimulus

It’s common to make HTTP fetch request to get some data from the server. It’s also convenient to update the HTML via Turbo Stream responses. What if you could combine the benefits of them both? This post shows you how to process Stream responses in JavaScript, without mucking around with the DOM.

Clientwork 6 min read
The Rails Config File

The Rails Config File

You must have used a `~/.bashrc` or `~/.zshrc` file to configure your environment. Did you know Ruby on Rails has a `~/.railsrc` file that configures your Rails applications? Not only that, it lets you pre-configure the gems you want in all your Rails applications. This post shows how it works.

3 min read

See Other After Destroy

This post explains why you should use the 303 See Other HTTP status after destroying a resource, instead of using 302 Redirect.

1 min read
Removing whitespaces from a String

How to Remove Whitespace from a String in Ruby

Often, you want to sanitize a string variable by removing all leading and trailing whitespaces around it. This is usually needed when you receive the string input from a user or an external source. This post shows you how.

Ruby Gems 2 min read
Sustainable Growth

Annual Blog Review: 2023

Every year, I do a personal annual review. This year, I thought why not do the same for my blog, since it has become such an integral part of my life, both personal and professional. This post contains some of the highlights and a list of all the articles I wrote in 2023.

Annual Review 31 min read

Page 6 of 17

Load More Something went wrong with loading more posts
  • Sign up
  • Homepage

© Write Software, Well 2025 - Powered by Ghost