Episodes
Johan André PRO said 9 months ago on Drag and Drop with Hotwire :
This is really awesome yet so simple.
Up to this day, I've been creating specific controllers for each resource.
Using SGID is brilliant.

Thanks for the tip!

cjstewar said 6 months ago on Drag and Drop with Hotwire :
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?

jcquarto said 6 months ago on Drag and Drop with Hotwire :
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 ?

David Kimura PRO said 6 months ago on Drag and Drop with Hotwire :
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.

jcquarto said 5 months ago on Drag and Drop with Hotwire :
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 !

Login to Comment