Skip to content

Blogging On Rails

Everything on Rails!

Radio Selection Unselect with Stimulus.js

Radio buttons, modeled after physical buttons on old radios, allow for only one element in a list to be selected. The browser automatically unselects the other options. This simple behavior often fits your needs, but I recently found myself wanting to be alerted on an unselect action so that I could change what was displayedContinue reading “Radio Selection Unselect with Stimulus.js”

Using Stimulus to Manage Stripe Elements

If you use Stripe to accept payments, you’ve likely had to insert the little Javascript snippet needed to wire up their library with your page. With a little refactoring, it works really well with a Stimulus controller. This setup simplifies your whole development process, and keeps your Javascript neatly stored together. Stripe’s JS & HTMLContinue reading “Using Stimulus to Manage Stripe Elements”

Stimulus.js Tutorial: Interactive Deletes with Rails UJS

This tutorial has an update using Turbo Streams and Stimulus. You can read it here: Stimulus.js & HOTWire Tutorial: Interactive Deletes Interactive websites have that feeling of immediacy. Clicked links respond in milliseconds, and there is never a need to wait… Waiting for a remote record to delete, and then the whole page refresh afterwardsContinue reading “Stimulus.js Tutorial: Interactive Deletes with Rails UJS”