Can anyone suggest any improvements to this code
def tree_to_nested_list(object, &block)
content_tag(:ol) do
content_tag(:li) do
html = yield object if block_given?
html += object.children.map { |child| tree_to_nested_list(child, &block)
}.join('\n')
end
end
end
Its intended to traverse an object graph and generate a nested list set
representing the hierarchy
Tony