<commit_before>= ActiveAdmin Sortable Tree

This gem adds a tree and a list view to your ActiveAdmin resource index,
both sortable via drag'n'drop.


== Installation

* Gemfile:

    gem "activeadmin-sortable-tree", :github => "nebirhos/activeadmin-sortable-tree", :branch => "master"


== Usage (Tree)

* Admin (eg. app/admin/page.rb):

    ActiveAdmin.register Page do
      sortable tree: true

      index :as => :sortable do
        label :title # item content
        default_actions
      end
    end

* Model: activeadmin-sortable-tree is agnostic to the tree
  implementation. All you have to do is expose a sorting attribute and
  a few tree methods (:parent, :children and :roots).
  Let's say you use Ancestry[https://github.com/stefankroes/ancestry]:

    class Page < ActiveRecord::Base
      attr_accessible :title, :body, :position<commit_msg>README installation warning<commit_after>= ActiveAdmin Sortable Tree

This gem adds a tree and a list view to your ActiveAdmin resource index,
both sortable via drag'n'drop.


== Installation

* Gemfile:

    gem "activeadmin-sortable-tree", :github => "nebirhos/activeadmin-sortable-tree", :branch => "master"


*WARNING!* Not compatible with neo/activeadmin-sortable[https://github.com/neo/activeadmin-sortable]


== Usage (Tree)

* Admin (eg. app/admin/page.rb):

    ActiveAdmin.register Page do
      sortable tree: true

      index :as => :sortable do
        label :title # item content
        default_actions
      end
    end

* Model: activeadmin-sortable-tree is agnostic to the tree
  implementation. All you have to do is expose a sorting attribute and
  a few tree methods (:parent, :children and :roots).
  Let's say you use Ancestry[https://github.com/stefankroes/ancestry]:

    class Page < ActiveRecord::Base
      attr_accessible :title, :body, :position
{'fraction_non_alphanumeric': 0.09591280653950954, 'fraction_numerical': 0.0, 'mean_word_length': 3.522167487684729, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7093936', 'n_tokens_mistral': 564, 'n_tokens_neox': 532, 'n_words': 188}