Sign up for my newsletter
Let's learn to become better developers.
Thoughts on Freelancing for Web Developers
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.
June 15, 2025
Redirects in Rails: Manual, Helper, and Internals
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 to see how redirect_to works under the hood.
June 07, 2025
Understanding the Render Method in Rails
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 your controllers.
June 05, 2025
Vibe Learning is Underrated
Last week, I used AI to finally learn the basics of QuickBooks and handle my company’s bookkeeping. AI didn’t just help me finish a chore, it taught me a skill I’d been avoiding for years. When used with intent, the modern AI tools can accelerate your learning in surprising ways.
May 27, 2025
Serving Large Files in Rails with a Reverse Proxy Server
If your Rails app deals with large files, let a reverse proxy like Nginx or Thruster serve them. In this post, we'll learn how X-Accel-Redirect (or X-Sendfile) header hands off file delivery to Nginx. We'll also read Thruster’s source code to learn how this pattern is implemented at the proxy level.
May 14, 2025
Fix N+1 Queries Without Eager Loading Using SQL Subqueries
In this post, we'll learn how to use a SQL subquery in a Rails app to eliminate N+1 queries and improve performance. We'll profile a real-world example, showing how to fetch a single record from associated has_many records efficiently without eager loading or excessive memory usage.
April 16, 2025
Reduce Memory Usage by Selecting Specific Columns
As your application grows, so do your database tables. If you keep fetching all columns, those extra fields, especially large text or JSON blobs can quietly eat up a lot of memory. This post shows how to reduce memory usage in your Rails apps by selecting only the columns you need from the database.
April 06, 2025
Profiling Ruby on Rails Applications with Rails Debugbar
This post shows how you can get a better understanding of your Ruby on Rails application performance with the Rails Debugbar, a profiling tool inspired by Laravel Debugbar. It also covers how to spot N+1 queries, reduce object allocations, and optimize SQL queries to improve page load times.
April 02, 2025
Why You Need Strong Parameters in Rails
In 2012, GitHub was compromised by Mass Assignment vulnerability. A GitHub user used mass assignment that gave him administrator privileges to none other than the Ruby on Rails project. In this post, I will explain this vulnerability and how you can use the Rails strong parameters API to address it.
March 19, 2025
Working with HTTP Responses in Rails
In this post, we'll learn how to work with the response object in Rails controllers — from inspecting response bodies and headers to setting status codes and content types. This guide also covers key methods like body, status=, content_type, cookies, and more, with practical examples.
March 10, 2025