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

I recently added sitemaps to a few Rails-based marketing sites I manage for clients, and within weeks, we saw a noticeable boost in search traffic. It reminded me that not many people know about them or have totally forgotten about them...
The Rails router's direct method lets you create custom url and path helpers, which is especially useful for polymorphic models and delegated types. This post shows how to use a single custom helper to generate URLs for different models,...
While reading the source code for the Maybe project (which is a really good Rails codebase that follows most of the Rails best practices and conventions), I came across this code in the router config file. It uses the Rails routing...
I started as a sceptic, but now I'm a convert and a heavy user of AI for everyday programming, and wanted to write down some common patterns and prompts for working with AI tools that I’ve found useful in my own development workflow as...
Over the past year, I’ve started heavily using AI tools like Cursor and ChatGPT in my everyday development workflow. They’re not a replacement for thinking, but I found them as excellent assistants for learning, debugging, refactoring,...
This post shows how to inspect the sequence of before, after, and around callbacks in Rails controllers by adding a small initializer. Useful for understanding callback order in applications with complex controller hierarchies or shared...
While debugging a Rails app, sometimes it's useful to see the full list of callbacks that are set to run before, after, or around a controller action, in the exact sequence they will run. This is especially true in applications with a...
After three years of freelancing and over a year of running my own software studio, here're some scattered thoughts on freelancing as a software developer, especially around web development.
If you’re an experienced web developer looking to go freelance, or just line up a few solid side gigs, there’s a simple shift that can make your life much easier: stop targeting upwork / individuals / mom-and-pop shops, and sell to...
You can safely extract options hash from the end of an argument list using the extract_options! method in Rails. Not only it simplifies the method definition but it keeps the method's API flexible, allowing you to add new options without...
In this post, we’ll explore how redirects work in Rails: what they are, how to redirect manually, and how the redirect_to method simplifies things. We’ll cover common use cases, security considerations, and even dig into the Rails source...
This is the seventh post in the series on Rails controllers.Redirects are an important part of the web, and Rails gives us a clean and expressive way to use them with the redirect_to helper method.But what's actually going on when you...
In this post, we'll learn how Rails' render method works and how to use it effectively. From rendering templates, partials, and inline content to JSON and custom status codes, this post explores the different ways to render views from...
This is the sixth post in the series on Rails controllers.When building Rails apps, we often take render for granted. It’s easy to let Rails implicitly render the default template or to drop in render :new to render a different...
A staging environment is a safe replica of production where you can test features before going live. In this post, we'll create a staging environment for the blog and deploy to it with Kamal. It also covers the basics of Rails...
Search Random