News for hackers. Stuff that matters.
Re:Learn Stimulus in Ruby on Rails by Building a Toggle) by marckohlbrugge on Monday June 26, 2023 @07:57PM (#36487445)
Great write-up!

I appreciate that you went the extra mile by showing how a generic enough controller can be used for various use cases.

People coming a from traditional JS background tend to make very specific Stimulus controllers, but when you make them a bit more abstract and modular they become more usable and easier to maintain.

Re:Learn Stimulus in Ruby on Rails by Building a Toggle) by hbroadbent on Monday June 26, 2023 @09:17PM (#36487900)
Thank you! I agree - I've seen other articles creating very specific controllers, which gets you into the issue of having heaps of specific controllers which could just be 1.

Glad you found the article useful!