Write Software, Well
Write Software, Well
Akshay
My name is Akshay, and I'm a software developer living in beautiful Victoria, British Columbia. I grew up in India, but Canada has been my home for the past 10 years. I am married to Pratiksha and we have a daughter, Suhani. I love programming in Ruby and building web applications with Rails. This blog is my attempt to share my learnings and to spread the joy of programming in Ruby with the world. Every day, I try to learn something new in Ruby and Rails and write about it.
Latest Posts
These are my notes from the first few chapters of Refactoring Databases by Scott Ambler and Pramod Sadalage. The book was published in 2006 and its examples are a bit outdated, but the underlying ideas translate well to modern Rails...
Last year, I announced plans to rewrite this blog in Ruby on Rails. It was hosted on Ghost for all these years (which is built with Node.js), and the idea was to rebuild it from scratch in Rails and write about the process as I went...
馃挕This post is part of a series on Active Storage internals. See also: Understanding the Active Storage Domain Model and How has_one_attached Works in Rails.Disclaimer: I used Claude Code to trace through the Rails codebase and explain...
This post is part of a series on Active Storage internals. See also: Understanding the Active Storage Domain Model and Understanding has_one_attached.Disclaimer: I used Claude Code to trace through the Rails codebase and explain how...
Two days ago, Rails added a new feature that makes working with bearer tokens easier. Before, you had to parse the Authorization header to extract them. Now, there's a dedicated bearer_token method on the request object that handles this...
Two days ago, Rails added a new feature that makes working with bearer tokens easier. Before, you had to parse the Authorization header to extract them. Now, there's a dedicated bearer_token method on the request object that handles this...
While going through recently merged PRs in Rails, I came across a new feature from DHH, that handles a common concern in app configuration: managing credentials across different configuration backends in a single, consistent manner.Add...
While going through recently merged PRs in Rails, I came across a new feature from DHH, that handles a common concern in app configuration: managing credentials across different configuration backends in a single, consistent manner....
In this post, we'll explore the internals of has_one_attached method in Active Storage. It covers two interesting patterns, i.e. proxy and change objects. We'll trace the control flow from the model DSL to persistence and uploads, and...
People usually read fiction before going to bed. I have a strange habit of reading the Rails source code at night. Not because it puts me to sleep, but for some reason I find the process of opening the Rails codebase, picking some...
Active Storage uses two main models: blobs and attachments. Blobs store the uploaded file's metadata and a link to the actual file, while attachments link those files to records. Understanding how they work together makes it easier to...
Active Storage is a wonderful library for managing file uploads in Rails. But terms like blob and attachment are easy to mix up, and that confusion can remain even after you鈥檝e been using Active Storage regularly. I鈥檝e run into that...
Localhost is treated as a trustworthy origin even without TLS, so all apps on localhost run in a secure context. This allows secure features to work in development. You can also run multiple apps on localhost with subdomains + ports to...
TL;DR: You can and should use localhost in development. Browsers give a special treatment to the http://localhost domain. Even though it's on HTTP, most of the time it will be treated as HTTPS. So any browser APIs that need HTTPS, will...
A sitemap lists your site's pages, helping Google crawl it efficiently. It's especially useful for large sites or new sites with zero backlinks. This post shows how you can create one in your Rails site, how to add it to Google Search...