Tutorials

Understanding Ruby’s `tap` — A Powerful Debugging and Configuration Tool - Harisankar P S | Ruby on Rails Developer
Ruby’s Object#tap is a small but powerful method that often goes unnoticed. It allows you to “tap into” a method chain, perform some operation, and return the original object—regardless of what the block inside returns. This makes it particularly ...

Fix N+1 Queries Without Eager Loading Using SQL Subquery
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 eage...

Sanitize your strings in JavaScript like a Rails developer | Rails Designer
Bring a little Rails into your JavaScript with super useful sanitize method to strip unwanting characters from your content.Ruby (and Rails) are known for great Developer Experience. Not in the least because of the many little helpers available. J...

Extracting Deprecation Warnings From the Rails Source Code - FastRuby.io | Rails Upgrade Service
Learn how to extract deprecation warnings from the Rails source code, for each version of Rails, using the Abstract Syntax Tree (AST) and tree-sitterBefore doing an upgrade, we strongly recommend doing the Roadmap to Upgrade Rails opens a new wind...



Rails 8 Assets: Adding a bundled package alongside vanilla setup | Radan Skorić's website
Propshaft + importmap-rails works great but can’t cover all possible cases. When you start reaching for more complex npm packages, you might encounter packages that require some form of bundling.
For example, let’s consider a relatively popular s...

Reduce Memory Usage of Your Rails App by Selecting Specific Columns
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 ...


Migrating Your Ruby Apps to the Latest Stack | Heroku
Do you run Rails or pure Ruby applications on Heroku? If so, it's important to be aware of upcoming end-of-life (EOL) dates for both your stack and your Ruby version. The Heroku-20 stack, built on Ubuntu 20.04 LTS, will reach EOL for standard supp...