Closed asecondwill closed 10 years ago
By default the sortable tree finds all roots for the model specified, regardless of nesting. This behavior may be customized through the roots_collection
option.
ActiveAdmin.register MenuItem do
belongs_to :menu
sortable tree: true,
# Only display the parent menu's roots
roots_collection: proc { parent.menu_items.roots }
end
@zorab47 - thanks so much. i've now got multiple hierarchical menu's working : )
I'm trying to make a menu management system for aa using your (awesome) gem. It should be simple enough, however I've hit a snag where the sortable view is showing all of the records, not just the ones for the nested resource.
Is that my user error or is this something the gem doesn't provide? (yet?)