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.
đ Modularize Your Code, Improve Organization! đ
In my latest blog post, I dive into how you can modularize your code and improve your applicationâs structure by automating the creation of Ruby gems. đ ïž [more inside]
2025 Reminder That DHH Is a Total Idiot!
2025 Reminder That DHH Is a Total Idiot!⊠https://andymaleh.blogspot.com/2025/03/2025-reminder-that-dhh-is-total-idiot.html
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. [more inside]
đ 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? [more inside]
Touch Events (swipe) using Stimulus
Create a touch-ready carousel + (Tinder-like) swipe functionality: https://railsdesigner.com/stimulus-touch-events/
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. [more inside]
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! [more inside]
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) [more inside]
đ 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. [more inside]
Me vs Typical Members of Ruby/Rails Subreddits
Me vs Typical Members of Ruby/Rails Subreddits ⊠https://andymaleh.blogspot.com/2025/03/me-vs-typical-members-of-rubyrails.html
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. [more inside]
đ 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: [more inside]
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. [more inside]
I Am Not a Fan of Ruby
I Am Not a Fan of Ruby⊠https://andymaleh.blogspot.com/2025/03/i-am-not-fan-of-ruby.html
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. [more inside]
đ 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. [more inside]
Everything You Need to Know About NodeJS Architecture
Learn everything about Node.js Architecture. Read Here: https://www.creolestudios.com/what-is-nodejs-architecture/
đ 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. [more inside]