class node
get_nodes(root_id, nodes, level,&block) <<参数更改
first_node = Node.find(root_id)
level += 1
if first_node.nil? or first_node.children.nil?
return
end
first_node.children.each do |node|
更改部分 >> nodes << yield(node,level)
get_nodes(node.id, nodes, level,&block)
end
nodes
end