zorab47 / active_admin-sortable_tree

Show ActiveAdmin index as a nested tree with drag'n'drop
MIT License
162 stars 127 forks source link

Add option to specify :roots_collection proc #20

Closed zorab47 closed 10 years ago

zorab47 commented 10 years ago

Allow users to define custom logic to find the roots of the tree to be rendered, while staying backward compatible.

Example

ActiveAdmin.register TreeNode do
  sortable tree: true,
    roots_collection: proc { current_user.tree_nodes.roots }
end