# View the new node added to a tree

**URL:** <https://www.ruby-forum.com/t/view-the-new-node-added-to-a-tree/140240>\
**Category:** Rails\
**Created:** [June 12, 2008, 7:24am UTC](https://www.ruby-forum.com/t/view-the-new-node-added-to-a-tree/140240 "2008-06-12T07:24:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![suneeta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b77776/32.png) [@suneeta](https://www.ruby-forum.com/u/suneeta)\
**Post date:** [June 12, 2008, 7:24am UTC](https://www.ruby-forum.com/t/view-the-new-node-added-to-a-tree/140240/1 "2008-06-12T07:24:37Z")

</div>

Hi…

```
I am working on data having tree structure. I did the insertion of

```

new node to the tree. After inserting I need to show the tree with the  
new node.

For example:

At first the tree looks like:  
- Root  
- Node 1  
Node 1.1  
- Node 1.2  
Node 1.2.1  
Node 1.2.2  
+ Node 2

I inserted a new node Node 1.1.1 under Node 1.1. After inserting this  
node I need to show the tree as follows:  
- Root  
- Node 1  
- Node 1.1  
Node 1.1.1  
- Node 1.2  
Node 1.2.1  
Node 1.2.2  
+ Node 2

A ‘-’ sign appears before Node 1.1, also the new node Node 1.1.1 is  
shown under Node 1.1

How will I achieve this? Please help me.

Thanks  
Regards  
Suneeta
