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.
minitest-substitute
Ever wanted to modify an ENV variable, an instance or class variable (e.g. on Config) for the duration of a block or for all tests of a “describe” group? This pattern emerged repeatedly in my suites and as I don’t like to bloat my test/spec helper, about time for the lightweight and dependency-free minitest-substitute gem. Drop cumbersome before and after handling with one or more easy to read with "ENV['FOO']", "bar" or with "@run_at", on: Config { Time.now } declarations. Happy testing!
GemRuby Show : Vladimir Dementyev, ActionPolicy
Hi fellow Rubyists, [more inside]
Ruby and the State of Artificial Intelligence
In this article, we delve into the State of Artificial Intelligence and Machine Learning in the Ruby Ecosystem, exploring the tools available, challenges faced, progress made, and the potential for the future:
Active-subscription only ActionCable broadcasting
An extract of a technique I’ve been running successfully to only render and broadcast payloads over ActionCable for users that are actively subscribed to the channel:
Should You Resolve All Of Your Exceptions? | Rubber Duck Dev Show 98
In this episode of the Rubber Duck Dev Show, we discuss whether you should resolve all of your exceptions:
System Tests
In this episode, we look at adding system tests in our application to test our Stimulus Controllers. We’ll also look at how to DRY up some of the tests and how to run them in a headless environment. https://www.driftingruby.com/episodes/system-tests
Unlocking the Power of Value Objects: A Fresh Approach to Cleaner Ruby Code
Do you find yourself running into the complexities of managing database adapters, or even just the intricacies of your own codebase? Ever thought there could be a simpler, cleaner way to deal with these challenges? [more inside]
Business Class 1.1 with Paddle Billing and improved scaffolding
Yesterday I released Business Class 1.1, a Ruby on Rails SaaS starter kit with support for Paddle Billing and an improved scaffolding generator which can now handle belongs_to associations.
What to do when the docs aren't enough
Software docs (Rails, Hotwire or otherwise), are often works in progress. Even well documented projects can be sparsely documented at their edges. What are you supposed to do when they aren’t enough? This article goes over five time-tested strategies and behaviors you can use when you reach a “docs dead-end” next time.
this JS ain't right - Arrow functions vs Function expressions
The this operator in JavaScript can be confusing. Here’s a brief article which goes into how JavaScript figures out what the value of this is, using some buggy Stimulus controller code as a starting point. [more inside]
Phoenix on Rails: Elixir and Phoenix for Ruby on Rails developers
Fancy learning something new? Phoenix on Rails is a 62-lesson tutorial on web development with Elixir and Phoenix, aimed at developers who already know Ruby on Rails. [more inside]
The RailsNotes Newsletter 🟥 ISSUE #9 (Deploying with Dokku, Hatchbox, Hetzner)
ISSUE #9 (Deploying with Dokku, Hatchbox, Hetzner)
[Podcast] DHH joins the show to talk Rails 8, Delegated Types, Kamal and more!
In this episode, I’m joined by DHH to discuss Kamal, The Rails Foundation, Rails 8, Delegated Types, On Writing Software Well and a whole lot more! This episode is packed and a must-listen! [more inside]
Full-text search with SQLite and Ruby on Rails
SQLite has a fts5 extension for this, but there is no gem, like pg_search, to have a replacement. [more inside]
Launching my ActionMailer component library! 📬
hey RF, I’ve been working on an easier way to build mailer templates, and it’s finally ready! If that excites you, you can check out my ActionMailer components and templates.
punkmaker gem - make your own (pixel) punk base (archetype) heads w/ your own colors
hello, back to (punk) pixel art. i have put together the (pixel) punkmaker (gem) for punk heads / characters that lets you use your own colors for base (arche)types incl. humans, zombies, apes, aliens, mummies, robots, and much more. yes, you can. happy image generating and pixel pushing with ruby.
Easy introduction to Connection Pool in ruby
Connection pool is on old engineering concept, yet it’s not so popular amongst Ruby on Rails developers. Let me present a simple example of using Connection Pool for maintaining connections to RabbitMQ. [more inside]
Cost-efficient Risk-free Ruby On Rails app redesign
This is how we’ve done it and the results we’ve achieved. [more inside]
Becoming a 10x Developer with ChatGPT and Copilot: A Rubyist's Perspective
Is the concept of a ‘10x developer’ still relevant in the age of advanced language models like ChatGPT and Copilot? In this article, I explore how these AI-powered tools can significantly boost productivity for Ruby developers. From effortlessly writing verbose test cases to generating utility snippets for libraries you rarely use, these tools are game-changers. I even delve into how ChatGPT can assist in navigating tricky office communications. Whether you’re a seasoned Rubyist or new to the language, you’ll find valuable insights on leveraging AI for more efficient and effective coding. [more inside]
Dependent Dropdowns with Hotwire
The latest issue of Rails Tricks covers how to do dependent dropdowns with Hotwire:
Fixing Thor’s CLI Quirks
I’ve been wanting to build a CLI in Ruby, and Thor is the obvious library to use. But Thor has some weird behaviors that were driving me crazy. Here’s what I found, and how I extended Thor to fix it.
ActiveRecord Internals: You are still not ready for this
🇬🇧Hello everyone, since I began my journey in Rails association sorcery recently. Here is an insight in Rails association internals ! (You might be not ready for this :p) [more inside]