Example of using "sortable-element" with nested lists?

I am having some trouble understanding how to use my controller to
look at what sortable-element gives me back for a nested list.

What I get back in my session looks like:
{“list”=>{“0”=>{“6”=>{“id”=>“64”}, “11”=>{“id”=>“120”},
“7”=>{“id”=>“65”}, “12”=>{“id”=>“121”}, “8”=>{“id”=>“69”},
“13”=>{“id”=>“144”}, “9”=>{“id”=>“75”}, “id”=>“18”, “0”=>{“id”=>“32”},
“1”=>{“id”=>“33”}, “2”=>{“id”=>“31”}, “3”=>{“id”=>“35”},
“4”=>{“id”=>“15”, “0”=>{“id”=>“17”}}, “10”=>{“id”=>“84”},
“5”=>{“id”=>“58”}}, “1”=>{“id”=>“50”}, “2”=>{“id”=>“125”},
“3”=>{“id”=>“126”}, “4”=>{“id”=>“133”}}

I can find lots of examples for simple lists, but am having trouble
expanding that in my head to handle nested lists. Can anyone point me
to an example of what the controller code might look like?

Thanks in advance,


Hi Alan,

Did you sort this out? I think one key would be to interpret what
those numbers are. What does your original list look like and what are
the ids of the elements?


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs