Submit a post
Post Preview
Note: Only the first pargraph is shown on the front page and overly long paragraphs may be broken up.
Today
The Developer's Way to Track Traffic: Self-Hosting Ackee or Plausible
I recently took a long look at my Rails projects and realized I was carrying around a piece of… [more inside]
rails-tenantify — row-level multi-tenancy for Rails 7+
rails-tenantify adds row-level multi-tenancy to Rails 7+ apps — one database, one organization_id column, no external service. Every multi-tenant SaaS needs scoped queries, safe background jobs, and protection against cross-tenant bulk SQL. acts_as_tenant is showing its age on Rails 7. Apartment pushes schema-per-tenant ops. rails-tenantify is a small gem that does the boring parts right. What you get (v0.1.2): → belongs_to_tenant :organization on any model → set_tenant_by :subdomain (acme.yourapp.com → tenant) → set_tenant_by :header (X-Tenant-ID for APIs) → Tenantify.switch_to / without_tenant → ActiveJob + Sidekiq: tenant context on enqueue and retry → Guards update_all, delete_all, destroy_all → Cross-tenant belongs_to validation → RSpec helpers: with_tenant / without_tenant → audit_overrides: :log, :raise, or :ignore Quick start: gem “rails-tenantify”, “~> 0.1.2”, require: “rails-tenantify” Tenantify.configure { |c| c.tenant_model = “Organization” } class Project < ApplicationRecord include Tenantify::Scoped belongs_to_tenant :organization end class ApplicationController < ActionController::Base set_tenant_by :subdomain end Built from a real multi-school Rails app (online exam system) with automated tenant isolation checks. Subdomain tenants work today; full custom domains on the roadmap. RubyGems: https://rubygems.org/gems/rails-tenantify GitHub: https://github.com/sghani001/rails-tenantify MIT · PRs welcome
I Used Claude Code for 30 Days on My Rails App. Here's What I Learned
Spent 30 days using Claude Code as my primary AI assistant on a real Rails monolith. Not a toy app, not a tutorial project. [more inside]
Count, Length, or Size? Avoiding ActiveRecord Performance Traps
I remember when I first started with Rails, I thought .count, .length, and .size were exactly the… [more inside]
rails-persona — behavioral analytics for Rails models, no Mixpanel needed
rails-persona adds first-class behavioral tracking to any ActiveRecord model. Define trackable actions with a DSL, then query frequency, inactivity, leaderboards, and daily activity patterns — all in your own database. Supports async Sidekiq tracking and bulk inserts. A focused alternative to ahoy for model-level analytics. [more inside]
How Rails Finds the View to Render
Rails does not render views by guessing filenames. It builds a template lookup query from the controller, action, format, variant, handler, and view paths, then asks Action View to resolve the best matching template. [more inside]
asgard v0.3.0 release Thor and Loki working for you!
I got tied of cussing the CLI task running that I’ve been using for a few years. It was good but it wasn’t Ruby. So I wrote my own. The power of The Mighty Thor for a great CLI experience with Loki managing the tricks of the trade. The power of Ruby endorsed by every mythical god of the higher realms. [more inside]
From ERB to Phlex: 5 Steps to Pure Ruby Views
I love Rails, but I’ve always found ERB to be a bit messy. You spend your whole day jumping between… [more inside]
View Primitives
I like the simplicity of traditional Rails apps and the component-based approach of ViewComponent, but I always felt the ecosystem was missing something like shadcn/ui. So I built View Primitives — a collection of reusable UI primitives powered by ViewComponent. Would love to hear your feedback. https://github.com/alec-c4/view_primitives
UUID v7 vs. ULID: Which Sortable ID Should You Choose?
For a long time, if you wanted a primary key that was both unique and chronological, you reached for… [more inside]
An impromptu lightning talk at Rubycon
Last week, I spent an extended weekend in Rimini, Italy, for the first edition of Rubycon. I decided to present an impromptu lightning talk to connect my reconversion story with the current trend of freezing hires of junior developers, and our responsibility as a community to offset/fight that trend.
Stop Making Ugly Apps: Simple Tailwind Tricks for Backend Developers
I know the feeling of opening a blank index.html.erb file and having no idea how to make it look… [more inside]
Building user-customizable themes with Tailwind CSS
https://railsdesigner.com/building-customizable-tailwind-themes/ — Using OKLCH you can tweak one custom property, e.g. :root { --color-value: 60; } and get a UI in all the colours of the rainbow! 🌈😊
The Better Primary Key: A Guide to ULIDs for Rails Developers
In a previous article, I talked about Snowflake IDs. They are great, but they require a bit of… [more inside]
Stop Chasing Hype: Why I Chose Postgres Over 'New-Age' Databases
I’ve lost count of how many times I’ve been tempted by a “revolutionary” new database. Every few… [more inside]