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.
Today
🚀 New Article: Mastering Ruby’s zip Method
If you work with arrays in Ruby, there’s one method you must have in your toolbox: zip. I just published a quick deep dive on how zip can help you: [more inside]
Hotwire components that refresh themselves
Using ViewComponents that know how to refresh themselves via turbo_streams is a powerful pattern to build complex flows with Hotwire [more inside]
Dependent Select
In this episode, we explore how to enhance standard select fields using a JavaScript library together with StimulusJS to create more dynamic and responsive dropdowns. The focus is on adding search functionality, handling dependent selections, and integrating smoothly with modern frontend setups. https://www.driftingruby.com/episodes/dependent-select
Breaking the Singleton: How to Reload Ruby Singleton Instance
Ruby’s Singleton module has an undocumented method that lets you reload instances. Here’s how I used it to fix my Rails tests - https://blog.arkency.com/breaking-the-singleton-how-to-reload-ruby-singleton-instance/
Capture Browser Console Logs in Rails System Tests with Capybara and Cuprite
Capturing browser console.log output in Rails system tests isn’t obvious with Capybara + Cuprite - especially when debugging timing issues that only show up at full speed. Here’s how to do it https://danielabaron.me/blog/capture-browser-console-logs-capybara-cuprite/
Anyone interested in a SF Ruby vibe coding hackathon this month?
SF Ruby vibe coding hackathon at Sentry HQ is just 2 weeks away! The $3,000 prize is sponsored by Fly.io, Continue, Evil Martians. Rails is known as the go-to tool for solo devs. Does AI take it to the next level? RSVP here.
Open file with source code from a crash page
https://github.com/igorkasyanchuk/editor_opener - with this gem, you can open a file in an editor directly from the crash page. Also, plan to make a PR into Rails, hope it will be merged.
🚀 Clean Ruby. Powerful Hash Transformations.
Ever needed to convert an array into a hash without messy loops? Ruby gives us two elegant tools for that: index_by and index_with. [more inside]
Making Sure FactoryBot Builds Without Creating
An RSpec spec to verify FactoryBot.build
doesn’t interact with the DB:
https://lovro-bikic.github.io/factory-bot-build-without-creating/
Active Record adds support for deprecating associations
Rails 8 lets you deprecate Active Record associations, making it easier to phase them out gradually while keeping them around to safely track and remove their usage. [more inside]
🔍 El que busca, encuentra — and Ruby proves it.
In my latest article, I explore how Ruby handles search operations across arrays, hashes, and other collections. From expressive methods like .find, .select, and .grep, to efficient algorithms like .bsearch, Ruby empowers developers to write clear and intentional code when looking for what matters. [more inside]
Think before you cache
Explore caching strategies and tools in Rails, from low-level manual caching to popular tools and gems that make caching easier. We’ll learn how to identify effective caching opportunities and avoid common pitfalls. [more inside]
OasRails: From a Rails Engine to a Framework-Agnostic Solution
Ruby is not just Rails, which is why I split my gem for API documentation, and now it could work with multiple frameworks. [more inside]
đź”§ Tired of deeply nested routes in Rails?
If you’re working with complex model relationships in Rails, shallow: true might be the clean solution you’re looking for. In my latest article, I explore how this simple option helps reduce route depth, simplify controller logic, and keep your code RESTful and maintainable — without losing model structure. [more inside]
đź§ľ New Post: Making Accessible PDFs with Ruby (PAC 2024 Edition)
Generating PDF/UA-compliant PDFs? Not as easy as flipping a flag. In this post, I document the battle with PAC 2024, Chrome quirks, and missing metadata—and how I used (and built) Ruby tools to fix it. [more inside]
5 gems you no longer need with Rails
Sometimes upgrading Rails apps makes app dependencies obsolete — their functionality is present in the framework. Dropping them would make future app maintenance easier. [more inside]
🚀 Rails + MongoDB? Absolutely.
Most of us default to PostgreSQL or MySQL when building Rails apps, but sometimes flexibility is key — and that’s where MongoDB shines. [more inside]
🔍 Did you know Ruby can inspect your entire system environment without any external
From getting the current file’s real path, accessing environment variables, checking user info, to even grabbing network details—pure Ruby has you covered. 🛠️ [more inside]
Ruby/Rails upgrade step-by-step
Recently, I’ve upgraded Ruby/Rails in a project. [more inside]
🚀 New Article: Boosting Reactive Programming with JIT – Reactive Ruby in Action
Have you ever faced performance issues while working with reactive systems? [more inside]