Module: ActsAsTreeDiagram::ViewDiagram

Defined in:
lib/acts_as_tree_diagram.rb

Instance Method Summary collapse

Instance Method Details

#diagram_molecules_tag(options = {}) ⇒ String

Animal.diagram_molecules_tag(where: { id: 1 }, path: animals_path).html_safe => "

  • 2
  • 3
  • "

    Parameters:

    • (defaults to: {})

      .

    Returns:

    
    
    21
    22
    23
    24
    # File 'lib/acts_as_tree_diagram.rb', line 21
    
    def diagram_molecules_tag(options = {})
      where = options.fetch :where, {}
      where(where).map { |x| draw_tree(x, options) }.join("\n")
    end