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.
Friendly Attributes Pattern
Friendly Attributes helps reduce typing and visual clutter when building record collections. It results in concise, readable, and even joyful code that captures the spirit of Ruby. Read more at:
Rails 8.1: Resilient Jobs, Better Logs, and Local CI
Rails 8.1 is here, and after digging into the new features, it looks like a solid upgrade šÆ. This release focuses on developer experience and production reliabilityājob continuations, structured logging, and local CI are the standouts. Read:
Failover Requests
In this episode, we look at creating a failover mechanism for API requests. This can be a handy trick in situations where you want to add fault tolerance to an API request. Weāll use the example of the Ollama Cloud as a failover to a locally hosted instance of Ollama.
Mesh Gradient Avatars in Rails
Dynamic avatars with Ruby are a common feature as we usually want to provide sensible default values without resorting to the same default avatar for every single user. The most common solution to this issue is to generate them using the userās initials, default images or background colors. These solutions are fine but we can do better: in this article we will learn how to create deterministic mesh gradient avatars using Ruby and the ChunkyPNG gem to improve our avatar game Read the full article on:
Ruby Enumerable methods: .each, .map and .select
Ruby Enumerablea Ruby module, and a big part of what makes Ruby a great programming language.
How to fix the new error "certificate verify failed (unable to get certificate CRL)"
Are your Ruby projects suddenly failing with the error ācertificate verify failed (unable to get certificate CRL)ā? Thatās due to a breaking change in OpenSSL 3.6.0. Read my article to see how to fix it.
You need gems? Look at ore!
You need gems? Look at ore! I wrote a little piece about this new tool to install your gems.
You Donāt Need Types in Ruby
Forcing static typing into Ruby is like putting a manual transmission in a Tesla. New post on why Sorbet misses the point entirely. [more inside]
The Joy of a Single-Purpose Class: From String Mutation to Message Composition
I canāt remember the last time I had this much joy introducing such a simple class. Started with Ruby 3.4 deprecation warnings, ended with a solution that leverages to_str for implicit string conversion and kills primitive obsession. [more inside]
The Potential of Ruby's ri Command for Coding Agents
The ri command already splits the document into well-chunked sections so that coding agents can get the correct context accurately. [more inside]
Middleware in Rails
What are they? What purpose do they serve? Why the hell do I need to know about this Rack thing?
Testing in Ruby: From Scratch to Minitest and RSpec
The complete Ruby testing tutorial: understand fundamentals by building a test framework, then explore Minitest, RSpec, and Rack::Test with practical examples. [more inside]
Code highlighting with Rails
As developers, there usually comes a time when we have to deal with syntax highlighting. Whether weāre building a blog, a CMS, a documentation site, or any other Rails app that accepts user-generated markdown, adding syntax highlighting to code blocks is an essential feature. In this article, we will learn how to add syntax highlighting to Rails applications by showing different ways to do it and a couple of nice tricks to improve the user experience. Read the full article on:
Bitmasks, Ruby Threads and Interrupts, oh my!
After a year hiatus, my Ruby series on all things Ruby concurrency is back, this time focusing on Ruby thread interrupts, which also digs into CRuby internals and bitmasks [more inside]
Switching From Ruby to SQL Schema in Rails
Need to switch from Ruby to SQL schema mid Rails project? Hereās how
Resolving the 'rest_framework' Module Not Found Error
The ModuleNotFoundError: No module named ārest_frameworkā is a common issue faced by developers working with Django REST Framework (DRF). This error typically indicates that your Python environment cannot locate the rest_framework package, which is essential for DRF to function correctly. Letās break down the most common causes and how to fix them.
Announcing Attractive.js, a new JavaScript-free JavaScript library
Because Rails developers donāt want to write JavaScript š
Ruby Butler: Time to Rethink RubyGems and Bundler
CMDx - Service object Zen šøšµššŖ·š§āāļøš
Say goodbye to messy service objects. CMDx provides a framework for designing complex business logic with clarity and consistency. https://drexed.github.io/cmdx/ [more inside]
Sentry Ruby SDK 6.0.0 Released
bringing several new capabilities and a few breaking changes. [more inside]