Module: ActsAsTreeDiagram::ViewDiagram
- Defined in:
- lib/acts_as_tree_diagram.rb
Instance Method Summary collapse
-
#diagram_molecules_tag(options = {}) ⇒ String
Animal.diagram_molecules_tag(where: { id: 1 }, path: animals_path).html_safe => “<li>
<a href="/animals/2">2</a>
<ul> <li><a href="/animals/5">5</a>
</li> </ul> </li> <li><a href="/animals/3">3</a>
<ul> <li><a href="/animals/7">44</a>
</li> </ul> </li>”.
Instance Method Details
#diagram_molecules_tag(options = {}) ⇒ String
Animal.diagram_molecules_tag(where: { id: 1 }, path: animals_path).html_safe
=> "<li>
<code><a href="/animals/2">2</a></code>
<ul>
<li><code><a href="/animals/5">5</a></code></li>
</ul>
</li>
<li><code><a href="/animals/3">3</a></code>
<ul>
<li><code><a href="/animals/7">44</a></code></li>
</ul>
</li>"
21 22 23 24 |
# File 'lib/acts_as_tree_diagram.rb', line 21 def diagram_molecules_tag( = {}) where = .fetch :where, {} where(where).map { |x| draw_tree(x, ) }.join("\n") end |