This is very cool. I have it working up until dropping the item from the drag. Then I am getting the error:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'dataset'). I am using rails 7 and esbuild though so I'm not sure if that is causing it. Any thoughts on why it is doing that?
I'm confused once sgid showed up. Is that a feature of hotwire ?
Also, I immediately thought of a part 2 for you (haha!): how to move items between multiple lists (example: a Trello board). I'm guessing that is "only" the addition of some sort of target list id ?
It’s part of Global Id in Rails. In the view, a signed global id is inserted as a data attribute and the record is located on the backend once’s passed through from the stimulus controller.
Can you make some suggestions for how to expand this to 2 lists? would the Stimulus controller would have to get re-written for each of the two lists on the page? And then get re-written again if the same list (but not the second one) is used on yet another page. Seems to make the number of file names multiply exponentially !
Up to this day, I've been creating specific controllers for each resource.
Using SGID is brilliant.
Thanks for the tip!
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'dataset'). I am using rails 7 and esbuild though so I'm not sure if that is causing it. Any thoughts on why it is doing that?
Also, I immediately thought of a part 2 for you (haha!): how to move items between multiple lists (example: a Trello board). I'm guessing that is "only" the addition of some sort of target list id ?