jquery-ztree-rails
This gem packages the jQuery zTree plugin for easy use with the Rails asset pipleine.
General Installation
- Add to the assets group in your Gemfile:
gem 'jquery-ztree-rails'
- Install the gem:
bundle install
- Add the JavaScript to
application.js
:
//= require ztree.core
//= require ztree.excheck
//= require ztree.exedit
//= require ztree.exhide
//= require ztree.all # include ztree.core, ztree.excheck, ztree.exedit
- Add the stylesheets to
application.css
:
/*
*= require ztree
*/
Example
$.fn.zTree.init($('#treeId'), setting, nodes);