Skip to content

Blogging On Rails

Everything on Rails!

Stimulus Pearls: A Collection of Stimulus.js Tutorials

Build the fastest website with Rails How many web pages actually need a JS framework? Most don’t. They just need sprinkles of interactivity. Stimulus.js provides the modern JavaScript framework to provide interactivity your user’s crave, without needing to relegate you Rails app to a JSON API.  New to Stimulus.js? Follow along with step by stepContinue reading “Stimulus Pearls: A Collection of Stimulus.js Tutorials”

Updated Tutorial: How Do I Drag and Drop Items in a List?

How do you configure a more complicated Stimulus controller that manages dragging items around in a list? Let’s start with our simple ordered Todo table in html: The todo order comes from a priority associated with each item, so that we’ll be able to keep track of which item needs to be moved. We alsoContinue reading “Updated Tutorial: How Do I Drag and Drop Items in a List?”

Updated Tutorial: How Do I Update My Model from a checkbox?

Let’s say you have a Todo app, with a model Todo that has a string title, and a boolean field, completed. We are going to use Stimulus to update our model remotely on the server when we check off the todo. And we’re going to use a nifty JavaScript API called fetch() to make itContinue reading “Updated Tutorial: How Do I Update My Model from a checkbox?”

Copyright © 2024 John Beatty. All rights reserved.