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.
Rails 7 supports tracking of belongs_to association
The article explains Rails 7 association_changed?
and association_previously_changed?
These two methods are added for tracking the changes for the belongs_to association.
https://blog.kiprosh.com/rails-7-supports-tracking-of-belongs_to-association/
Less code 👉 better performance? FIND OUT (Opal)
🧗‍♀️ A great journey into improving the quality of the JavaScript output produced by the Opal compiler, that unexpectedly lead to better performance 🙌 and and more readable code 💻. [more inside]
Video: How to use React with Rails 7
Rails 7 is coming and it has changed the way it deals with JavaScript (again). In this video tutorial, we’ll look art how to use React with Rails 7 using the default import maps method. This lesson is part of a new free course on full-stack Rails. In the next lessons, we’ll also look at using JavaScript bundlers (esbuild, rollup.js, Webpack) and gems like react-rails and react_on_rails to build a modern full-stack Rails 7 app. [more inside]
Signal handling in concurrent apps with Ruby and Polyphony
Polyphony is a library for writing highly concurrent Ruby apps. Polyphony harnesses Ruby fibers and a powerful io_uring-based I/O runtime to provide a solid foundation for building high-performance concurrent Ruby apps, while letting developers use stock Ruby core and stdlib classes and APIs. In order for provide a solid developer experience, Polyphony reimplements different parts of the Ruby runtime functionality, which are adjusted so developers will see a consistent and reliable behaviour. My latest article discusses the problem of signal handling in concurrent Ruby apps.
Rubber Duck Dev Show Episode 20 | How Do You Start Testing
Hear two rubyists discuss different ways to start adding tests to your project: https://www.rubberduckdevshow.com/episodes/20-how-do-you-start-testing/
Glimmer DSL for Specification - Specification-First Engineering
Despite Ruby’s highly expressive nature, all testing toolkits written in Ruby are either imperative (e.g. using assert
or expect
), thus losing expressiveness and focusing software engineers on the wrong thing, or mix non-Ruby code with Ruby (e.g. cucumber & gherkin), thus missing out on the simplicity of Ruby. Glimmer DSL for Specification aims to provide a simple minimalistic and noun-based declarative syntax. [more inside]
Draw Color Repeat - Sandra's Samples
DCR (Draw Color Repeat) is a minimal subset of Logo that teaches computer programming to young children in elementary school. Sandra, an elementary school girl, was kind enough to share her own programs written in the DCR Programming Language. [more inside]
Writing AWS Lambda Functions in Ruby
AWS Lambda lets you run your code without worrying about the nuts and bolts of server management or scaling. You might even say it’s “serverless.” In this article, Jeffrey Morhous shows us how to get started writing Lambda functions in Ruby. https://www.honeybadger.io/blog/aws-lambda-functions-ruby/
Audit Logging in Rails
Need to add audit logging to your Rails application? In this post, I review five popular Ruby gems you can use, walk through rolling your own solution, and share some recommendations about what solution to choose. https://hybrd.co/posts/audit-logging-in-rails
3 useful examples of using typed structs in ruby.
Check out those 3 examples of useful applications for using dry-struct in your system. [more inside]
Punks, The William Shakespeare Edition - Super-Rare Never Before-Seen Pixel Portraits
Hello, in the ongoing pixel (art) programming series - yes, in ruby - I put together new samples. Let’s welcome Punks, The William Shakespeare Edition - Super-Rare Never Before-Seen (Pixel Punk) Portraits of the World’s Greatest Writer - Anno 2021. Yes, you can. (Re)generate super-rare never-before seen (pixel punk) portraits of the world’s greatest writer that you own 100% forever in your own home - see the genius/shakespeare script. Cheers. Prost.
ROM and Sequel over ActiveRecord?
Have you wondered what are the alternatives for ActiveRecord and why Hanami uses ROM instead? Here is why! [more inside]
Glimmer DSL for SWT File Drag and Drop
The Hello, Drag and Drop! sample included in Glimmer DSL for SWT has been enhanced with various different types of drag and drop in v4.21.2.2, including File Drag and Drop (files coming from outside the application). [more inside]
Oktest.rb 1.2.0 released -- performance improved
Oktest.rb 1.2.0 released, a new-style testing library for Ruby. In this release, performance improved. Now Oktest.rb runs about five times faster than RSpec. Other changes are listed in CHANGES.md. See README for details about Oktest.rb.
The hidden features of caller
I use Ruby’s caller
feature a lot when I’m debugging and trying to figure out the stack trace of a particular code path. I used to think that it couldn’t do much beyond returning the full stack trace as an Array. But it’s got some tricks! Read more.
Setter Method Return Values In Ruby
Ruby setter methods may not return the result you expect them to. Find out what they return, and why, in this article.
command_kit 0.2.1 released
command_kit 0.2.1 has been released! This release contains many minor improvements and fixes. command_kit is a toolkit for building clean, correct, and robust CLI commands as plain-old Ruby classes. command_kit also provides many additional CLI features such as ANSI colors, OS/Distro detection, Package Manager detection, XDG directory support, opening a man page when --help
is given, spawning less
for paged output, etc.
Railway Oriented Programming In Rails Using Dry-Monads
It’s not every day that you learn a new approach to error handling for Ruby. In this article, Abiodun walks us through a novel error-handling process called Railway Oriented Programming and shows us how to implement it with dry-rb’s monads. https://www.honeybadger.io/blog/railway-programming-dry-monads/
The Template Method Pattern in Ruby (video)
The Template Method pattern allows you to extract the parts of your code that stay the same into a base class and the ones that change into subclasses. [more inside]
Keeping time with TimescaleDB: understanding and integrating time-series data with Ru
⌛On the Martian blog, Backend Engineer Misha Merkushin addresses a timely question – how can we efficiently and effectively store time-series data when working with Ruby on Rails applications? [more inside]
Full Text Search in Postgres with View-Backed Models in Rails
Here’s a fast way to add full text search across multiple AR models using the PgSearch and Scenic gems, while also surfacing a distinct domain concept in your Rails application. https://hybrd.co/posts/full-text-search-in-postgres-with-view-backed-models-in-rails