All threads / How to use rails and sortable connected lists

Ask A Question

Notifications

You’re not receiving notifications from this thread.

How to use rails and sortable connected lists

Graeme Ellis asked in Rails
Hello!

I'm trying to create sortable connected lists with a single modal. Two lists that I want to move items between and then display. I've successfully followed the video on sortable with a single list. Should I add a table column that tracks which list the item is in?
http://jqueryui.com/sortable/#connect-lists

Summary, how should I record what list an item is in? and then of course how can I display the two list in a view?

I'm over my head on this one for sure 😆. 
Thanks for your help!
Graeme
Hey Graeme, 

Did you see the Trello series? We cover moving between multiple lists in that. It'd be slightly different code since it's in Vue.js but the concept would be all the same. You would need a List model and association to keep track like you mentioned.
Thanks Chris! I'll check it out
Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 33,665+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.