Module: LcpRuby::TreeHelper

Defined in:
app/helpers/lcp_ruby/tree_helper.rb

Instance Method Summary collapse

Instance Method Details

#render_tree_rows(roots, children_map, columns, depth:, default_expanded:, match_ids:, reparentable: false, search_active: false) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'app/helpers/lcp_ruby/tree_helper.rb', line 3

def render_tree_rows(roots, children_map, columns, depth:, default_expanded:, match_ids:,
                     reparentable: false, search_active: false)
  return "".html_safe if roots.blank?

  roots.each_with_index.map { |record, idx|
    render_tree_row(record, children_map, columns, depth: depth,
      default_expanded: default_expanded, match_ids: match_ids,
      reparentable: reparentable, search_active: search_active,
      guides: [], is_last: idx == roots.size - 1)
  }.join.html_safe
end