Stimulus Discourse

More Rails.ujs, and Stimulus stuff

I’ve been on a 3 month journey de-jQuery-ing. Stimulus came into the picture about two months ago and I’m getting better, but…

I, like many have run into problems moving to Rails.ujs. I wrote a little gist Rails.ujs and Simulus approaches that describes that journey in more detail.

It describes three approaches. The old $.ajax approach used in jQuery, and two Rails.ujs approaches. I did this because I got tired on not understanding why things didn’t work, I just wrote a simple test page that didn’t muck with models and a lot of other stuff - just a simple controller and some html.slim and stimulus controllers.

It came down to, just like the stimulus.js reference is short, it has almost everything you need, but you need to re-read it a few time. The Rails guide on Javascript (outdated) is about the same. It’s there but not written for someone who does not have a lot of experience with this stuff.

I put up a link on one of my demo apps

demo