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.
Delegated types in Rails: I tried them, and I'm not sure I really understood them.
Developers have been scratching their head trying to figure out delegated types for ages. Today, I want to share a real-world use case. I’ll walk you through my pre-existing domain architecture, my initial requirements, my mistakes, how I eventually used delegated types, what I learned and my open questions.
New SudoRails version has been released 🚀 Sudo mode for your Rails controllers 🔒
Protect any Rails action with a customizable password confirmation. 🙇 Inspired by GitHub Sudo mode. [more inside]
Handling Exceptions in Grape for Ruby
Let’s explore the basics of Grape exception handling, including customizing exceptions: https://blog.appsignal.com/2024/04/17/handling-exceptions-in-grape-for-ruby.html
The tale of an XSS in Phlex
I reported an XSS to Phlex yesterday and since it was pretty quickly fixed, I wrote a post about it: https://greg.molnar.io/blog/the-tale-of-an-xss-in-phlex/
Introducing Janus a read/write proxy for ActiveRecord 7.1+
Janus is a read/write split proxy for MySQL/ActiveRecord 7.1+. It works by sending any read queries to a replica, and any write queries to the primary database server. If there’s been a write statement within the same thread we stick any future queries to the primary server unless the developer specifically chooses not to. [more inside]
Create a MacOS desktop application with pure Ruby (Tutorial)
This is (for now) a modest step-by-step tutorial about creating a MacOS desktop application with Ruby. [more inside]
Automating Rubocop Into Your Rails Development Workflow
This video will show you a couple of ways to run Rubocop early and often so you and your team can ensure you’re avoiding inconsistencies and bugs while maintaining your code for the long haul.
Forcing a Rails database column to be not null
Here is a guide to forcing null constraints in Rails. It explains why, how to do it in different circumstances, and an introduction to change_column_null
.
New release of OnStrum, configurable application healthcheck rack middleware 🚀
This gem allows you to embed healthcheck endpoints into your rack based application to perform healthcheck probes. Make your application compatible with Docker/Kubernetes healthchecks in a seconds: https://github.com/on-strum/ruby-on-strum-healthcheck
Making a (Sidekiq) Batch Recipe
This post introduces Sidekiq Pro’s batches feature. It builds some tests that exercise batches to explain how they work. [more inside]
Hands-off eclipse photography with ruby and gphoto
How I automated exposure bracketing to take pictures of the eclipse totality using ruby and gphoto: https://yboulkaid.com/2024/04/10/eclipse.html
How to Build a Discord Bot in Ruby on Rails
In this guide, Fiona walks you through the process of creating a Discord bot using Ruby on Rails. [more inside]
Super Fast Rails – A promise given is a debt
Last week’s article, Super Fast Rails, received many funny reactions. But for some people, that was too much: https://www.rorvswild.com/blog/2024/super-fast-rails-a-promise-given-is-a-debt
Account-based subdomains in Rails
Learn how to isolate data in Rails with multitenancy and customize your user experience with account-based subdomains. It’s all in our latest article on the Honeybadger Developer Blog.
Process management in Ruby 💎
Application, process, heap, stack, wow that’s a lot of triggering words. Ever wondered what they are and how they are translated in the Ruby world? 💎 [more inside]
An interactive intro to ruby debugger, part 2
I’ve expanded my interactive intro to ruby debugger, inside the debugger itself, with an introduction to using breakpoints: An interactive intro to ruby debugger, in the debugger
Do you still `pbcopy` and `pbpaste`?
Nothing’s wrong with that, but the advantage you get with the clipboard gem is that it works on many more platforms than just macOS (including Windows). [more inside]
Abstract methods and NotImplementedError in Ruby
Ruby’s NotImplementedError exception is often used as a placeholder in abstract classes for methods that should be implemented by subclasses. But did you know that this is not how this exception class was intended to be used? [more inside]
Windows and WSL
In this episode, we’ll look at setting up a fresh Windows 11 environment for Ruby on Rails development. We’ll be looking at a few different tricks that makes managing a Windows environment much easier. https://www.driftingruby.com/episodes/windows-and-wsl
How to add or remove a Stimulus controller
A quick memo about how to add or remove a Stimulus controller - I recommend to rely on generator this time. [more inside]
Introducing ActiveRecordAnonymizer
Excited to share a new Ruby gem I’ve been working on: ActiveRecordAnonymizer! 🚀 [more inside]