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.
How to build modals with Hotwire (Turbo Frames + StimulusJS)
Hotwire allows us to add Single Page App (Turbo Frames), or AJAX (Turbo Streams) functionality without writing any custom Javascript! (It has all been pre-written for us). [more inside]
Rails 7 application inside Docker on macOS: Part two - database and Mutagen
How to create Rails 7 app with all dependencies hidden inside a Docker container link
Don't waste your time on assets compilation on Heroku
At some point, you may want or be forced to use the CDN to serve assets of your Rails app. When your app is globally available, you may want to serve the assets from strategically located servers around the world to provide the best possible experience for the end user. Serving static assets via Puma is not the best idea — it’ll be slow. The only viable option on Heroku is to use CDN. I will show you how to do it smart, save time and have faster deployments [more inside]
Ruby on Rails Forms With Hotwire (video)
I wanted to find out if Hotwire can be as good, or better than something like React JS. But… I wasn’t sure if Hotwire is up to it.
The In-depth Guide to ActiveRecord load_async in Rails 7
The In-depth Guide to ActiveRecord load_async in Rails 7 Rails 7 introduces ActiveRecord load_async API that runs SQL queries asynchronously in the background thread. This seemingly simple change of just adding a single new method that takes no arguments has profound implications for database layer interactions. In this tutorial, we’ll deep dive into the intricacies of this new API. We’ll discuss lazy-loaded queries, Ruby threading model, blocking IO, database pool vs. max connections limit, and performance impact of concurrent database clients. I’ll also try to suggest scenarios where introducing async SQL queries could have the most benefit without sacrificing the stability of your Rails app. [more inside]
Your app is not your business!
Separating the business domain apart from the application layer can help a lot in untangling your code and simplifying architecture. [more inside]
Glimmer Wordle 1.1.0
Glimmer Wordle 1.1.0, which is written in Glimmer DSL for SWT (JRuby Desktop Development GUI Framework), has been released with a number of improvements. [more inside]
S3 direct file upload using presigned URLs from React and Rails
Recently, we were working on a project where the backend was a Rails API and the front-end application was written in React. We had to implement a feature for a file upload. We worked out a solution to upload files directly to S3 using presigned URLs.
Rails administrate : big tutorial, bits of philosophy
administrate is a gem that allows you to build an admin dashboard. It’s often qualified as DSL-less admin builder, i.e. every file your admin dashboard rely on, can be fully overridden by the developer. Let’s see how. [more inside]
Glimmer DSL for LibUI Progress Spinner
I received a GitHub issue request the other day asking how to implement a progress spinner in Glimmer DSL for LibUI (Ruby Desktop Development GUI Library). I did a quick implementation of it using area vector graphics, and documented it under the newly added Area Animation section in the README. [more inside]
Ruby Fiber Scheduler
Ruby can work asynchronously with just a Fiber Scheduler and a couple built-in methods – no frameworks are required! [more inside]
Rubber Duck Dev Show Episode 31 | How To Learn a New Code Base
Hear from two rubyists about ways you can learn a new code base:
Glimmer DSL for SWT Video Tutorial 4 - Hello, Layout!
The Glimmer DSL for SWT Video Tutorial 4 is out! It walks software engineers through Hello, Layout! [more inside]
Introduction to Hotwire in Ruby on Rails (video)
With the release on Rails 7, Hotwire has generated a lot of confusion among Rails devs. So in this video, we’re going to look at how Hotwire works together with Stimulus and Turbo. [more inside]
Ruby - attr_accessor, attr_writer, and attr_reader
In Ruby, object methods are public by default, while data is private. To access data, we use the accessor method. [more inside]
The Economics of TDD
Getting started with TDD can be challenging, but it’s a game-changer. The increased speed and ROI cannot be compared with other development methods such as waterfall. [more inside]
Truemail 2.7.0 has been released 🚀 configurable plain Ruby 📨 email validator
Added ability to specify SMTP port number for SMTP validation layer. Be sure that email address valid and exists.
9 Ways To Make Slow Tests Faster
A test suite will gradually slow down unless it is dutifully maintained, dragging the team’s morale down and making your organization miss deadlines. [more inside]
PG zero-downtime migration from int to bigint (with Ruby on Rails notes)
If you have an integer column you must migrate to a bigint column and you can’t afford downtime (or you’re interested in how that can be done) this blog post gives the recipe. [more inside]
Cucumber Founder Aslak Hellesøy on TDD and BDD
🎧 Great interview with the Cucumber founder - Aslak Hellesøy [more inside]