ActsAsTreeDiagram

ActsAsTreeDiagram extends ActsAsTree to add simple function for draw tree diagram with html.

Ruby Gem Version Ruby Style Guide CircleCI

See It Work

tree_diagram

Usage

  1. Append the following line to your app/assets/application.scss: scss @import 'acts_as_tree_diagram'
  2. And append the line to your model file like below: ruby class Animal < ApplicationRecord extend ActsAsTreeDiagram::ViewDiagram acts_as_tree order: 'name' end
  3. Then append the line to your view file like below: html <div id="act_as_tree_diagram"> <ul class="tree"> <li> <code> <%= link_to Animal.find(1).name, animals_path(Animal.find(1)) %> </code> <ul> <%= Animal.diagram_molecules_tag(where: { id: 1 }, path: animals_path).html_safe %> </ul> </li> </ul> </div>

Installation

Add this line to your application's Gemfile:

gem "acts_as_tree_diagram"

And then execute:

$ bundle

Or install it yourself as:

$ gem install acts_as_tree_diagram

Development

Test

bin/test

Contributing

Bug reports and pull requests are welcome on Github at https://github.com/routeflags/acts_as_tree_diagram. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Changelog

TimelineRailsHelper's changelog is available here.

Code of Conduct

Everyone interacting in the PunchClock project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

You may enjoy owning other libraries and my company.

Аcknowledgment