ActsAsTreeDiagram

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

Ruby Gem Version Ruby Style Guide CircleCI

See It Work

treediagram

Usage

  1. Append the following line to your app/assets/application.scss:
@import 'acts_as_tree_diagram'
  1. And append the line to your model file like below:
class Animal < ApplicationRecord
extend ActsAsTreeDiagram::ViewDiagram
acts_as_tree order: 'name'
end
  1. Then append the line to your view file like below:
<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.

  • for the Japan Meteorological Agency (気象庁) for searching new information simplifies.
  • Work time calculations using punch clock.
  • Record your test suite's computed CSS during future test runs for deterministic and accurate tests.

Аcknowledgment