Exercise: Minesweeper in 100 lines of clean Ruby
This article is part 1. Part 2 uses code from this article to make the game multiplayer using Rails and Hotwire. Ruby is such an expressive language. You can often do surprisingly much with just a...
This article is part 1. Part 2 uses code from this article to make the game multiplayer using Rails and Hotwire. Ruby is such an expressive language. You can often do surprisingly much with just a...
A code smell, put loosely, is code that looks like it’s going to be trouble. When it’s correctly identified you usually discover that: it’s hiding a much bigger problem it’s tightly coupled t...
Let’s consider some UI examples and mentally check if we can get the Turbo magic by just slapping a Turbo Frame in the right place. By that I mean: can we make the implementation really as simple a...
The problem Consider the following examples on a Rails application that is using Turbo Frames. Example 1: Clicking the login link brings up a login form in a popup modal. You can also navigate to...
Update (January 8, 2025): When I originally wrote this article the behaviour described in it was not official. But, I also opened two PRs: one to add a test to Turbo that validates the behaviour an...
The point Best practices earn their name by being used with success by many people in many different situations. Over many attempts, on average, they worked better than other practices. Hence the ...
Update 2024-04-09: Added a second tutorial on using breakpoints. This is an introduction tutorial to Ruby debugging, inside the ruby debugger itself. The instructions are woven through the code so...
When working on projects with other developers you might (like me) find yourself wanting to customize the project console in a way that’s not useful as a default but it is useful for you. And ideal...
Turbo’s morphing feature can look magical. There’s a lot of pieces moving behind the scenes to make it come alive. That’s great when it works but when it doesn’t you might be left staring at the sc...
Test factories are a widely used tool for writing automated tests. The other main alternative are test fixtures but here I am assuming you are using factories. I have extensively used both over man...