Sha256: e6fead81421bdf6d5c205c4676b267a5c3507ee9a3a94d0a1f6fb6e1f5c32c08
Contents?: true
Size: 377 Bytes
Versions: 31
Compression:
Stored size: 377 Bytes
Contents
module Smithy module PagesHelper def tree_for_select tree_for_select = [] Smithy::Page.each_with_level(Smithy::Page.root.self_and_descendants) do |page, level| prepend = level == 0 ? '' : "#{'-' * level} " tree_for_select << [ "#{prepend}#{page.title}", page.id] end if Smithy::Page.root.present? tree_for_select end end end
Version data entries
31 entries across 31 versions & 1 rubygems