Keith Schacht’s Weblog

Subscribe

Wednesday, 16th October 2024

📝 I’m loving Rails Stimulus; check out this example. #

I’m working on a site that has a left column for navigation. Standard stuff. But I wanted a simple control that lets you hide and show the left column.

When I first started using Stimulus, I would create a left_column_controller.js. Within it, in the connect() and disconnect() methods I would add and remove listeners. It worked, but it was verbose and I wasn’t enjoying Stimulus. Later, I refactored all my stimulus controllers to extract common interactions. Now I finally “get” Stimulus and I’m loving it!

Read more ▾

2024 » October

MTWTFSS
 123456
78910111213
14151617181920
21222324252627
28293031