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.
Extremely fast Javascript bundling in Rails with Esbuild
The new jsbundling-rails gem allows you to use esbuild, rollup, or other Javascript bundlers in Rails. With esbuild, we can build our Javascript extremely fast compared to webpacker. How to use esbuild with jsbundling in Rails
ActiveSupport's #descendants Method: A Deep Dive
The #descendants method is part of Rails. It returns all subclasses that inherit from a given class. In this article, Jonathan Miles shows us how to use this method and how it’s implemented. It’s a great lesson in the ins and outs of Ruby’s object model. https://www.honeybadger.io/blog/hidden-gems-activesupport-descendants/
Rails Wizards (w/ Hotwire) Series
A 9-part series exploring the multiple ways to do wizards / multi-step forms in Rails including Hotwire for an SPA-like workflow. https://jonsully.net/blog/rails-wizards-part-one/
Error Tracking from Scratch
In this episode, we look at creating a middleware to track errors to publish to another error “from scratch” error monitoring application. https://www.driftingruby.com/episodes/error-tracking-from-scratch
httpx 0.18.0 released - http client for ruby (concurrency, HTTP/2)
0.18.0 Features Response Cache [more inside]
CDNget 1.0.0 released -- download files from public CDN
CDNget is a small tool to download files from public CDN, such as CDNJS, jsDelivr, UNPKG, or Google. Release 1.0.0 improved download performance. See README for details. https://github.com/kwatch/cdnget/tree/ruby-release
Hanami 2.0 - Complete example of persistance with ROM
In this new Hanami Mastery Episode, I showcase the complete persistence layer of a Hanami 2.0 application. YT video guide included! [more inside]
Rubber Duck Dev Show Episode 13 | REST vs. GraphQL APIs
Hear two rubyists discuss the differences between REST and GraphQL APIs: https://www.rubberduckdevshow.com/episodes/13-rest-vs-graphql-apis/
New (Modern Dotty Spotty) Currency Art Programming How-Tos (with Ruby)
Hello, Inspired by Damien Hirst’s “The Currency” art (token) parody / 40+ million $$$ cash grab I have created an all new /currencyart-howto repo that collects getting started guides (and scripts) - yes, in ruby - for creating your own free (modern dotty spotty) currency art in retro pixel bitmap raster format or in hi-definition (hi-def) XXXL poster-size quality vector graphics format. Happy pixel pushing and art programming in ruby.
array_include_methods 1.4.0
array_include_methods 1.4.0 has been released (Array#include_all?, Array#include_any?, Array#include_array?, Array#array_index, Array#array_intersection_indexes, and Array#array_diff_indexes methods missing from basic Ruby Array API) [more inside]
Setting Up Rails 6.1 + Tailwind CSS 2.2 with JIT
This tutorial shows how to create a project with Rails 6.1 and its default Webpacker version (4.5), and configure Tailwind CSS with its dependencies and JIT mode enabled. You’ll end up with a project that compiles the final CSS automatically, and refreshes the browser for you as well, after every change.
Run every version of ruby, ever, with All-Ruby
Yep. That includes ruby-0.49. And it’s super easy! [more inside]
Rails 7 replaced byebug with ruby/debug
Rails 7 removed Byebug from Gemfile and added ruby/debug More Inside
Code Golf: Conditionally Add To An Array
Ruby’s expressiveness and vast API provides a myriad of ways to solve the same problem. This post proposes different ways to add elements to an array only if a certain condition applies. [more inside]
Multi-Factor Authentication for Rails With WebAuthn and Devise
If someone steals your password, they can pretend to be you. That’s why many companies provide two-factor or multi-factor authentication via a fingerprint scan, a YubiKey, an authenticator app, or SMS. In this article, Petr Hlavicka will give you a solid foundation of knowledge about multi-factor authentication and will walk you through implementation with Rails, Webauthn, and Devise https://www.honeybadger.io/blog/multi-factor-2fa-authentication-rails-webauthn-devise/
Ruby's Popular Game Library, Gosu, is having its Inaugural Game Jam
Join the first Gosu Game Jam and help choose the theme. [more inside]
Rubber Duck Dev Show Episode 12 | Programming with Dates, Times & Zones
Hear two rubyists discuss programming with dates, times and zones: https://www.rubberduckdevshow.com/episodes/12-programming-with-dates-times-zones/
Ruby 3.1 allows value omission in hash literals
Ruby 3.1 adds a shorthand syntax in Hash literals. It is similar to the shorthand syntax of objects in ECMAScript6. More Inside
Glimmer DSL for SWT 4.21 (New SWT/JDK/JRuby)
Glimmer DSL for SWT 4.21 is the quarterly major release that ships with a new version of SWT as well as other big changes like JDK 16 and JRuby 9.3.0.0 [more inside]
Turn 28px Golden Bored Apes into Damien Hirst-Inspired "Currency" Modern Art
Hello,
Using the pixelart gem I’ve put together a little artistic script - yes, in ruby -that turns any 28x28px golden bored ape into Damien Hirst-inspired high-definition (hi-def) XXXL modern art. The script uses a 2x zoom with quadruple pixels all turned into random-sized ~circles~ spots and the background filled with random Damien Hirst inspired currency-like ~circles~ spots. Change the Image#spots parameters to fit to your taste. Generate your own million $$$ art collection today. Yes, you can. Happy pixel pushing with ruby.
Using Rails 6 with Tailwind 2 JIT and Esbuild without Webpacker
TailwindCSS with Rails: The Quickest and Easiest Way [more inside]
Buffered IO Streams In Ruby
Ruby IO may not immediately write where you are asking it to. Here we explore where writing to a stream goes and when it may or may not be committed where you would expect it to.