{"id":15064619,"url":"https://github.com/dalpo/rails_admin_nestable","last_synced_at":"2025-10-08T18:18:41.548Z","repository":{"id":4725220,"uuid":"5873738","full_name":"dalpo/rails_admin_nestable","owner":"dalpo","description":"RailsAdmin drag \u0026 drop custom action sorting list and tree (using the Ancestry gem) :gem:","archived":false,"fork":false,"pushed_at":"2023-03-08T11:27:35.000Z","size":322,"stargazers_count":103,"open_issues_count":13,"forks_count":72,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-09-30T20:16:16.101Z","etag":null,"topics":["ancestry","rails-admin","ruby","ruby-on-rails"],"latest_commit_sha":null,"homepage":"http://andreadalponte.com/rails_admin_nestable/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dalpo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2012-09-19T15:15:42.000Z","updated_at":"2025-05-07T06:31:13.000Z","dependencies_parsed_at":"2023-01-13T13:13:05.331Z","dependency_job_id":"fd3478f5-fb18-47fa-9a18-b9904d952dc9","html_url":"https://github.com/dalpo/rails_admin_nestable","commit_stats":{"total_commits":120,"total_committers":22,"mean_commits":5.454545454545454,"dds":0.525,"last_synced_commit":"1146e1a2c6b5865c3e13919f6ebd6bbbc317a9e5"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/dalpo/rails_admin_nestable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalpo%2Frails_admin_nestable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalpo%2Frails_admin_nestable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalpo%2Frails_admin_nestable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalpo%2Frails_admin_nestable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dalpo","download_url":"https://codeload.github.com/dalpo/rails_admin_nestable/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalpo%2Frails_admin_nestable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278877088,"owners_count":26061380,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ancestry","rails-admin","ruby","ruby-on-rails"],"created_at":"2024-09-25T00:22:42.716Z","updated_at":"2025-10-08T18:18:41.529Z","avatar_url":"https://github.com/dalpo.png","language":"JavaScript","readme":"# Rails Admin Nestable\n\nRailsAdmin Drag and drop tree view for `Ancestry` and `mongoid-ancestry` gem\n\nSample demo available at: https://github.com/dalpo/rails_admin_nestable_demo\n\n[![Gem Version](https://badge.fury.io/rb/rails_admin_nestable.png)](http://badge.fury.io/rb/rails_admin_nestable)\n[![Code Climate](https://codeclimate.com/github/dalpo/rails_admin_nestable.png)](https://codeclimate.com/github/dalpo/rails_admin_nestable)\n\n## Installation\n\nTo enable rails_admin_nestable, add the following to your `Gemfile`:\n\n```ruby\ngem 'rails_admin_nestable', '~\u003e 0.3.2'\n```\n\nAdd in your `config/initializers/rails_admin.rb` initializer the configuration:\n```ruby\nRailsAdmin.config do |config|\n  config.actions do\n    # root actions\n    dashboard                     # mandatory\n    # collection actions\n    index                         # mandatory\n    new\n    export\n    history_index\n    bulk_delete\n    # member actions\n    show\n    edit\n    delete\n    history_show\n    show_in_app\n\n    # Add the nestable action for configured models\n    nestable\n  end\nend\n```\n\n## Configuration\nYou could choose between two different configurations for your model:\n\n### 1. Nestable tree:\nTo use this configuration, you need to organize your tree model with [Ancestry](https://github.com/stefankroes/ancestry) or [Mongoid Ancestry](https://github.com/skyeagle/mongoid-ancestry).\nOtherwise your model have to respond to the `parent`, `arrange` and `children` methods.\n\nThe `nestable_tree` methods supports the following options:\n  * `position_field`: (symbol) default =\u003e `nil`\n  * `max_depth`: (integer) default =\u003e `nil`\n  * `enable_callback`: (boolean) default =\u003e `false`\n  * `scope`: (symbol | proc) default =\u003e `nil`\n  * `live_update`: (boolean | :only) default =\u003e true (:only is for live updating only)\n\nIn your `config/initializers/rails_admin.rb` initializer:\n```ruby\nRailsAdmin.config do |config|\n  config.actions do\n    ...\n  end\n\n  config.model MyModel do\n    nestable_tree({\n      position_field: :position,\n      max_depth: 3\n    })\n  end\nend\n```\n\n\n### 2. Nestable list:\nTo use this configuration, you need a position field\n\nThe `nestable_list` methods supports the following options:\n  * `position_field`: (symbol) default `:position`\n  * `enable_callback`: (boolean) default =\u003e `false`\n  * `scope`: (symbol | proc) default =\u003e `nil`\n  * `live_update`: (boolean | :only) default =\u003e true (:only is for live updating only)\n\nIn your `config/initializers/rails_admin.rb` initializer:\n```ruby\nRailsAdmin.config do |config|\n  config.actions do\n    ...\n  end\n\n  config.model MyModel do\n    nestable_list true\n  end\nend\n```\n\n## Authorization with [CanCan](https://github.com/ryanb/cancan)\n\nSample ability:\n```ruby\nclass Ability\n  include CanCan::Ability\n\n  def initialize(user)\n    user ||= User.new\n\n    if user.admin?\n      can :access, :rails_admin\n      can :dashboard\n\n      if user.role? :superadmin\n        can :manage, :all\n      end\n\n      if user.role? :editor\n        can :edit, :all\n        can :nestable, :all\n      end\n    end\n  end\nend\n\n```\n\n\n## Screenshot\n\n![Nestable view](https://github.com/dalpo/rails_admin_nestable/raw/master/screenshots/nestable_tree.jpg \"nestable view\")\n\n\n## Contributing\nSubmitting a Pull Request:\n\n1. [Fork the repository.][fork]\n2. [Create a topic branch.][branch]\n3. Implement your feature or bug fix.\n4. Add, commit, and push your changes.\n5. [Submit a pull request.][pr]\n\n[fork]: http://help.github.com/fork-a-repo/\n[branch]: http://learn.github.com/p/branching.html\n[pr]: http://help.github.com/send-pull-requests/\n\n\n## Thanks\n\n* [Carlo Scortegagna](https://github.com/carloscortegagna)\n* [Andrea Zaupa](https://github.com/andreazaupa)\n* [Rails Admin](https://github.com/sferik/rails_admin)\n* [Nestable](http://dbushell.github.com/Nestable)\n* [To see the generous people who have contributed code, take a look at the contributors page](https://github.com/dalpo/rails_admin_nestable/graphs/contributors)\n\n## License\n**This project rocks and uses MIT-LICENSE.**\n\nCopyright 2015 Andrea Dal Ponte\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdalpo%2Frails_admin_nestable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdalpo%2Frails_admin_nestable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdalpo%2Frails_admin_nestable/lists"}