Let's Configure a PostgreSQL Database Server for the Blog In this post, I'll provision and configure the staging infrastructure for my blog, which is a Rails application. This includes installing and setting up a PostgreSQL database server, allowing connections only from the Rails application server, and locking it down by disabling direct public access.
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.
Decoding the Business Layer of Software Announcing a new newsletter where I write about topics beyond Ruby on Rails: running a software services business, freelancing, positioning and marketing for developers, working with AI, hiring and tech recruiting, etc. Business Logic is about everything that happens around writing software, well.
Let's Create a New Rails Application for the Blog This is the first post in the series where I'm building my blog in Ruby on Rails. I'll create a new Rails application and we'll walk through some of the important files and directories in a fresh Rails project. By the end of this post, we'll have a basic app up and running in the browser.
I am Rebuilding this Blog with Rails After three years on Ghost, I'm rebuilding this blog from scratch with Ruby on Rails. In a new series, I'll document the journey of building a production Rails application, from development to deployment. Follow along as I build the new home for Write Software, Well.
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.
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.
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.
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.
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.
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.
Working with HTTP Requests in Rails Every web application needs to process incoming HTTP requests. In this post, we’ll take a closer look at how Rails handles requests, how you can access the request object in the controller, and some of the most useful methods it provides to gather meaningful data from the request.