A collection of posts of interest to Ruby and Rails developers.
Hand-picked, high signal, always on topic.
Maintained by @skillstopractice.com
Also available as a feed:
https://bsky.app/profile/did:plc:ip3trmvdbnlm4g7cdc5xs7ub/feed/aaaf5jle4pb7e
Ruby + Rails : Distilled is moving to Mastodon.
Just getting set up over there but you'll find the account here:
ruby.social/@distilled
I will set up bridging when I can, not sure if I will do crossposting though.
If you're set up with @ap.brid.gy here I can still share your posts that way.
I just signed the open letter to the Rails Core team, after hesitating for a long time about whether that was the right choice for me.
I know and like several Rails core members, as well as several Basecamp employees. I understand the squeeze that can happen when speaking out individually only […]
So the way I read this is a sponsor forced this action by Ruby Central.
If that sponsor was Shopify, then in effect, this confirms that a company that DHH is a board member of forced this action.
If not, who was responsible for this then?
This is a very […]
[Original post on mastodon.social]
ViewComponents reduce bloat, simplify data, and create reusable frontend styling. Despite these benefits, they're often under-utilized in the Rails community. I've written a blog post refactoring a real-world example into isolated ViewComponents.
joshfrankel.me/blog/viewcom...#ruby#rubyonrails
How do you manage error classes in your app?
- Granular — Domain::Specific::NotFoundError
- Generic/Reusable — Error::NotFound
- Not — StandardError/raise 'x'
Personally, I create my own error classes so I can see what's wrong at a glance, even if it means catching existing ones.
#RubyLang
Already several good RSS feeds in the thread.
Keep them coming! Discoverability is hard these days and RSS was one of those lovely tools that deserves a comeback.
If you've got a blog where you (at least sometimes) write Ruby-related posts, please reply with a link to your RSS feed below.
I am going to try to start keeping an eye on those as well and sharing interesting stuff I find from time to time.
If you've got a blog where you (at least sometimes) write Ruby-related posts, please reply with a link to your RSS feed below.
I am going to try to start keeping an eye on those as well and sharing interesting stuff I find from time to time.
Don't want to expose a class' initializer in Ruby? Making it private is easy!
Just use `private_class_method :new`.
This conveys intent that your class is not designed to be initialized from outside — perfect when you want to use the factory pattern.
How to automatically trigger a file download with Turbo?
The user triggers the creation of a file. That file is created using a background job. I could update the view using Turbo Streams (e.g. render a 'Download Now' button). But I'd like download to automatically start 🤔
#rubyonrails
Namespaces 101
During the last days I have done an immersion into namespaces, the new big feature that is coming in Ruby.
Here's a digested mental model for you all.
gist.github.com/fxn/86ad8584...
Incredibly common Rails perf anti-pattern:
Rails.cache.fetch([complicated,cache,key], expires_in: random_interval) do
dog_of_a_SQL_query
end
Cache hitrate: 10% (if anyone even knows what it is)
hey #RubyLang folks - our tests against Ruby head in sentry-ruby started failing yesterday with:
LoadError: cannot load such file -- cgi/cookie
I'm disabling ruby head version in our CI matrix for the time being but maybe there's a fix somewhere?
Your periodic reminder that consolidating a wobbly design is worse than a waste of time, it interferes with further improvement. Sometimes the best thing is put all the elements in one pile until the fault lines become clear. #AugmentedCoding#GeniesDesignBadly
Having setters that appear to be at the instance level apply at the class level is something that (for me) definitely would be against the Principle of Least Surprise.
An easy way to define class level accessors is nice but hard to see the use case for the instance level behavior.
TIL about the ActiveSupport `mattr_accessor` method. It defines both class and instance accessors for class attributes.
Handy little shortcut! 🔧
#ruby#rubyonrails
Absolutely love this. Have figured out a bunch of this stuff from first principles over the last 2 years, but still loads of goodies in here.
plainvanillaweb.com/index.html
Consider using pattern matching in Ruby.
I wanted to update a user's location (RGeo Point) from an endpoint which receives a JSON object: { lat: ..., lng: ... }.
Using pattern matching, we can detect such an object's shape, falling back to a catch-all (_) with an if statement for regular Points.
What's the "Rails" way of designing a multi-step workflow with background jobs? Each job triggering the next, active record callbacks, state machines or something else? Help!
TinyBits: A new schema-less binary serialization format. Fast to encode, fast to decode and generally smaller output than all other schema-less formats.
Currently available as a preview for C and Ruby. A Python module is also in the works.
oldmoe.blog/2025/05/05/s...
TinyBits is getting a new interesting feature, you can now (using the repo's head) supply the pack/unpack method with an external dictionary.
For shorter messages with no duplicate strings this can lead to a dramatic size reduction, from 96 to 34 bytes in the example below
I write mostly about #RubyLang here allaboutcoding.ghinda.com
And I write shorter notes (mostly saving some of the posts I share on social media) at notes.ghinda.com
who up there writing their blog?
i want to see yalls blogs!
criteria:
- you wrote at least a post in 2025
- it doesn't force a paywall so we can actually read it
With charge-per-request 3rd-party services (not only LLM APIs), how are you managing spending limits within your apps?
I know some of these services have budget features, but I'm more interested in strategies where you have your own spend control -- e.g. rate limiting, token buckets, alerts...
Who's actually using #Ruby LSP in #VSCode to run tests?
I am trying it out today and its command to run all tests from current file seems to be running *each test scenario* in a separate process. This means that running all tests is dead slow.
Am I doing something wrong?
Anyone have better approaches to wiping Active Storage files after #RSpec test runs in #RubyOnRails?
```
config.after(:suite) do
dir = ActiveStorage::Blob.services.fetch(:test).root
FileUtils.rm_rf(dir)
FileUtils.mkdir_p(dir)
FileUtils.touch(File.join(dir, ".keep"))
end
```
Using database constraints (not nulls, foreign keys, unique compound indexes, etc.) in your Rails app isn't just good for data integrity. It also indicates system intent to others in a way that using Active Record validations alone just can't.
Terminalwire is now open source! I finally had time to think through the license and landed on AGPL.
More in the article about "why", "why now", and a tour of the source code on Github.
terminalwire.com/articles/agp...
I love what you can do with Hotwire & a bit of Stimulus 🤩
Here's a quick way to lazy-load some content on click using an empty turbo frame. Setting the source attribute automatically loads the content.
#rubyonrails
When a controller is full of custom actions named:
- `#create_[thing]`
- `#update_[thing]`
- `#delete_[thing]`
It usually means that `[thing]` is a missing concept in your domain.
Consider extracting those actions into a new `[things]_controller.rb` class or something similar.