# Tricky rjs rendering

**URL:** <https://www.ruby-forum.com/t/tricky-rjs-rendering/86499>\
**Category:** Rails\
**Created:** [February 22, 2007, 7:58pm UTC](https://www.ruby-forum.com/t/tricky-rjs-rendering/86499 "2007-02-22T19:58:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [February 22, 2007, 7:58pm UTC](https://www.ruby-forum.com/t/tricky-rjs-rendering/86499/1 "2007-02-22T19:58:44Z")

</div>

until then I don’t have any problem with .rjs rendering , but I am using  
a plugin which build a network tree

 @root, :initial\_data\_options =\> { :depth =\> 1 }, :allow\_click\_branch =\> true } %\> \</div this helper generating script in my page \<div id= "network\_tree" \</div

I need to render this tree again from an .rjs , I trying writing the  
rails code in partial, and using page.replace.html to replace the  
innerHTML, I also tried the page.replace… no way… if I try with a  
another partial with simple HTML code , it’s ok, so I believe I am doing  
something wrong in rendering this helper… but I have no idea why ?  
any clue will be aprpciated

thanks

---

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [May 2, 2007, 2:58pm UTC](https://www.ruby-forum.com/t/tricky-rjs-rendering/86499/2 "2007-05-02T14:58:32Z")

</div>

Hi Kad,

I almost have the exact same problem!  
When I try to render live\_tree using RJS,  
Firebug throws an “illegal character” error  
for the JS created.

When I use rhtml templates,  
live\_tree is sort of rendered  
(meaning you can see the root and its clickable children)  
but the whole layout gets broken,  
all other content is lost,  
all css stuff is lost  
and Firebug throws a million JS errors…

Using a

  
wrapped around live\_tree doesn’t help.

I am using live\_tree with the “:find\_item\_proc” option  
getting data from the file system  
(just like in one of the live\_tree author’s examples).

If you found a solution for this problem,  
please let me know.

Cheers,  
Tom.

On Feb 22, 8:58 pm, Kad K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [July 11, 2007, 9:24pm UTC](https://www.ruby-forum.com/t/tricky-rjs-rendering/86499/3 "2007-07-11T21:24:00Z")

</div>

having the same problem here,

did you ever find a solution?

> When I use rhtml templates,  
> live\_tree is sort of rendered  
> (meaning you can see the root and its clickable children)  
> but the whole layout gets broken,  
> all other content is lost,  
> all css stuff is lost  
> and Firebug throws a million JS errors…
