Tutorials

Calculating the largest known prime in Ruby - JP Camara
Looking to impress your Ruby friends by calculating the largest known prime, 2 ** 136_279_841-1?
On Ruby 3.4.0-preview2 and earlier, 2 ** 136_279_841-1 logs a warning and returns Infinity 😔:
2 ** 136_279_841-1 # warning: in a**b, b may be too big ...


Automating barcode scanner tests with Capybara
A lot of barcode scanners are basic human interface devices — essentially behaving like a keyboard and not requiring any special drivers. Essentially, they just type on a keyboard very quickly. They’ll support lots of different styles of codes — f...

Fixing Gem Install Errors on M3 Mac with Ruby 2.7 · Daniela Baron
Starting a new role always comes with exciting challenges, and one of my first tasks in a recent new role was setting up a 10-year-old legacy Rails project on an M3 MacBook. The project was running Rails 6.1 and Ruby 2.7.8, with several older vers...

Overriding Methods in Ruby on Rails: A No-Code-Editing Approach
Recently, I installed the Writebook a Ruby on Rails app from 37signals because I wanted to publish some long essays or long-form articles about testing for developers.
The installation worked like a charm, including replacing Rescue with Solid Qu...


Process slow network requests with Turbo and Active Model
Learn how to build a dynamic loading screen without writing a line of JavaScriptI recently had the opportunity to improve the UX on a client project by backgrounding a slow network request and broadcasting the response to the browser asynchronousl...

Upgrading to Rails 8 from Rails 7 | by Patrick Karsh | Oct, 2024 | Medium
Rails 8 brings a host of new features, performance improvements, and security enhancements, making it a valuable upgrade for developers looking to maintain the stability and security of their applications. Some of the key reasons to upgrade includ...

Easy Rails controller rate limiting with Rails.cache
This makes use of Rails.cache to store a key for 20 seconds. If the method is hit again while the key exists, we return an error. Otherwise we allow the operation to complete.
This is a quick and easy way to add a simple rate limit to a controlle...

How we made a Ruby method 200x faster · Campsite
One morning, Campsite was slow. Normally snappy interactions had loading spinners and delayed data.
Our observability tooling let us know it wasn’t just us, and it gave us some hints about what was happening.
An Axiom monitor sent us a “high API...