The Ruby and Rails community linklog
Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!
Submit a post
Post Preview
Note: Only the first pargraph is shown on the front page and overly long paragraphs may be broken up.
Implementing an Inventory Module in Ruby on Rails: Handling Concurrency with Database
When implementing an inventory module in a Ruby on Rails application, ensuring consistency in stock levels is crucial. If multiple users try to purchase the same item simultaneously, concurrency issues can lead to overselling. In this post, we’ll explore two approaches to handling inventory management: using a simple counter with database locks to prevent race conditions & improving performance and reliability using SKIP LOCKED for efficient inventory allocation. Read more
🚀 Mastering Rails Migrations: The Power of change_table 🚀
Are you handling database migrations efficiently in your Ruby on Rails projects? Many developers use add_column, rename_column, and remove_column separately—but did you know that change_table can streamline multiple modifications in a single block? Read more
Touch Events (swipe) using Stimulus
Create a touch-ready carousel + (Tinder-like) swipe functionality:
How to Configure Sign in With Apple in Rails 8 without Omniauth
I recently battled to get “Sign in with Apple” working without using the OmniAuth gem just to get the nice looking button from Apple. 😆 This guide explains all the quirks and gotchas you’ll need to get it working too. Read more
Want to make your GitHub profile stand out? 🚀
Your GitHub page is more than just a collection of repositories—it’s your developer portfolio. Whether you’re looking for new job opportunities or showcasing your open-source contributions, making your profile visually appealing can set you apart! Read more
Rails 8 Assets: Combining importmaps
Here’s how to combine Importmaps to be able to use different maps on different parts of the website: Rails 8 Assets: Combining importmaps
Example of how to use Data class
I followed up from last week article about value objects with some examples of usage I found in some of my own projects and one from TheOdinProject
📬 Letter Thief - An emails logger for Rails
Would you like to log emails in your Ruby On Rails app? Letter Thief logs sent emails in your database and can also open them in development. If you used letter_opener you should be familiar with it, but now you can also use it where you don’t have a disk (like Heroku) Read more
🚀 Simplify Ruby Gem Development with Docker! 🛠️
If you’re looking for a clean, reproducible way to scaffold a new Ruby gem, check out my latest article! I walk through how to set up a Dockerized development environment with PostgreSQL to ensure a smooth and consistent workflow. Read more
Me vs Typical Members of Ruby/Rails Subreddits
Me vs Typical Members of Ruby/Rails Subreddits …
How to configure Postgres as an Accessory with Kamal 2 and Rails 8 on a single server
This guide shows how to deploy a Rails 8 app with a Postgres database using Kamal 2 to a single VPS. It makes up for the lack of documentation around Postgres accessories in the official Kamal docs and helps you avoid common configuration errors connecting to the accessory DB from your Rails app. Read more
🚀 Writing Clean, Reusable, and Scalable Code in Rails
As Rails developers, we constantly strive to write efficient, maintainable, and DRY code. In my latest article, I explore: Read more
A Ruby implementation of the HyperLogLog algorithm for efficient cardinality
Hyll is a Ruby implementation of the HyperLogLog algorithm for the count-distinct problem, which efficiently approximates the number of distinct elements in a multiset with minimal memory usage. It supports both standard and Enhanced variants, offering a flexible approach for large-scale applications and providing convenient methods for merging, serialization, and maximum likelihood estimation. Read more
I Am Not a Fan of Ruby
I Am Not a Fan of Ruby…
Rubocop Obsession 0.2 released
Rubocop Obsession’s MethodOrder cop now supports and autocorrects the alphabetical style on top of the more classic drill_down and step_down top-to-bottom styles. Ordering methods alphabetically may look unusual at first, but on the flip side it is a reliable and unambiguous ordering style. In any case, it is good to have options!
Rails MCP Server - Enhancing AI-Assisted Development
The Rails MCP Server provides a set of tools that allow Claude to interact directly with my Rails projects. This enables a more seamless workflow when I need AI assistance with my codebase. Read more
Running interactive sessions with Kamal
Here’s how to run interactive sessions with Kamal.
🚀 Mastering State Machines in Ruby on Rails 🚀
In my latest article, I dive into the powerful world of state machines in Ruby on Rails and how you can leverage external gems like state_machines and AASM to manage state transitions effectively. Read more
Everything You Need to Know About NodeJS Architecture
Learn everything about Node.js Architecture. Read Here:
🚀 Handling File Transfers in a Heroku Environment with Net::SFTP 🌐
As developers, we often face unique challenges when working with cloud platforms. Recently, I had to deal with an interesting issue—downloading a file generated on the fly within a Heroku server. Since Heroku’s filesystem is ephemeral, retrieving the file wasn’t as straightforward as it seemed. Read more
How to create value objects in Ruby - the idiomatic way
I wrote an article exploring what I think should be the idiomatic way to create value objects in Ruby since 3.2 Read more
Avoiding PaaS Lock-in
Are you using a platform? Ever thought about using a different platform? If so, it probably makes you a little nervous Read more
Ruby OOP Done Right with Responsibility Driven Design
For those who missed it, here is the video of the recent Montreal.rb talk “Ruby OOP Done Right with Responsibility Driven Design”: