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.
Ask_ChatGPT new release (streaming, CLI, etc)
now with streaming support (see response instantly), a CLI tool, and some other improvements. [more inside]
[ANN] httpx 0.23.0 released
httpx 0.23.0 has been released. [more inside]
Ruby Retry But Better: Faraday Loop
Ever need a simple way to retry a block of code? Maybe you need a maximum number of retries? Exponential backoff? Different handling for different exceptions? We took the Faraday Retry Middleware which is pretty awesome and just hoisted it up into its own utility without actually using/needing Faraday: Faraday Loop
dry-credentials
Ever wanted to use encrypted credentials in a non-Rails project without having to pull ActiveSomething dependencies? Take a look at the new “dry-credentials” gem. It’s not part of the dry organisation but related in spirit.
Update half a Billion records in Rails
Ever wonder how would Rails handle updating 600M records in PostgreSQL. Answer is Pretty well! In this article I will show you how. [more inside]
7 Common Mistakes in Rails Upgrades
Ruby on Rails is a popular web application framework that is constantly evolving with new versions being released frequently. While upgrading to a newer Rails version can bring new features, better performance, and security patches/improvements, it can also be a challenging task. [more inside]
Hacking Rails Implicit Rendering for View Components & Fun
I went in-depth at https://fly.io/ruby-dispatch/hacking-rails-implicit-rendering-for-view-components/ on how I got a Rails app working that uses 100% Phlex components. The technique can be used to integrate Rails with ViewComponents, handle batch resource selection & manipulation, responder classes, Hanami-style action classes, and more.
Reflection on doing a 24h startup challenge in Rails
Last week, I finished my 24 hours startup challenge. I was building an uptime monitoring tool with Rails. Here’s my reflections.
⚡ Chaskiq, the self-hosted live chat, releases version 2.0.0 ⚡
We are thrilled to announce the release of Chaskiq 2.0.0, a major milestone for our source-available live chat and messaging system. This update marks the successful migration of our text editor, Dante. [more inside]
Configuring RuboCop to scan the right files in a Rails project
Despite using RuboCop for years, I was recently surprised to find that it was not scanning certain important files in my Rails project. When I dug further, I discovered that RuboCop’s system for configuring inclusion and exclusion rules is quite complicated and exhibits some of the infamous “Rails magic”. What started out as a simple question – why isn’t RuboCop checking my bin/setup script? – turned into hours of troubleshooting. Here’s what I learned:
Leaving the Cloud With Chris & Creston | Rubber Duck Dev Show 82
In this episode, we discuss whether you should consider leaving the cloud:
Rice 4.1 (Creating Ruby bindings for C++ libraries)
Rice makes it much easier to wrap C++ APIs - it is the Ruby equivalent to PyBind11. Get started with the tutorial at https://jasonroelofs.com/rice/4.x/tutorial.html. After you are done with the tutorial, there is extensive documentation about how to wrap C++ libraries - see https://jasonroelofs.com/rice/4.x/bindings.html. The Rice authors would love to see more Ruby bindings to C++ libraries and are happy to offer pointers as needed - please submit tickets on Github.
Project-specific .irbrc
offers a solution to having a project-specific .irbrc while also keeping a global ~/.irbrc for shared functionality.
Gosu Game Jam 4 has began!
The theme is: Platformer [more inside]
Using a Redlock Mutex to Avoid Duplicate Requests
How I found and fixed a tricky request processing race condition using Ruby, Redis, and Redlock
ChatGPT from your Rails console
- do you want to ask ChatGPT for help directly from the Rails console? Examples: [more inside]
Glimmer DSL for LibUI 0.7.x Table Selection and Sorting API
In the 0.7.x version series, Glimmer DSL for LibUI finally gets the much awaited Table Selection API and Table Sorting API that got added to the underlying libui C library a few months ago. The good news is tables are now sortable by default without having to write a single line of code (Convention Over Configuration). That means all older applications that had tables now have sortable tables. [more inside]
Solidus v3.4 is out
We’re thrilled to announce the release of Solidus v3.4! This release marks an important milestone for our e-commerce platform as we move closer to the highly anticipated v4 release. We invite you to upgrade to v3.4 and address any deprecation warnings to ensure a smooth transition to the future of Solidus. [more inside]
lazy_value gem
Load values on your pages using Ajax. Literally with one line of code: <%= lazy_value_tag { User.active.count } %>
How to keep up with your usual sending volumes without a drop?
How to mitigate sending risks and be able to deliver those VERY IMPORTANT emails to your customers’ inboxes no matter what? [more inside]