Drag and Drop Nested List with Stimulus and Rails

I need to do a draggable (drag and drop) nested list with use of stimulus + RoR.

Expected behaviour: When user drops an item (item A) inside another one (Item B) - Item B should became parent item for Item A. Any tips how to approach this?

1 Answer

you can do this with sortable js.

There is also a ready-made Stimulus controller in Stimulus Components that you could get inspiration from.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Alexander Ross

Alexander Ross

Gaming, Esports & Interactive Media Writer

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.

Share this article
Twitter Facebook Pinterest