# Rich Text Editor and link\_to\_remote

**URL:** <https://www.ruby-forum.com/t/rich-text-editor-and-link-to-remote/128754>\
**Category:** Rails\
**Created:** [February 11, 2008, 10:06am UTC](https://www.ruby-forum.com/t/rich-text-editor-and-link-to-remote/128754 "2008-02-11T10:06:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tktktk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a3d4f5/32.png) [@tktktk](https://www.ruby-forum.com/u/tktktk)\
**Post date:** [February 11, 2008, 10:06am UTC](https://www.ruby-forum.com/t/rich-text-editor-and-link-to-remote/128754/1 "2008-02-11T10:06:05Z")

</div>

Hi

How can I get link\_to\_remote to call a new page and respect the  
javascript within that page.

I do have an edit page for datarecords, that have a textarea which is  
enhanced with the YUI Rich Text Editor. If I call that edit page  
through link\_to\_remote, the editor isn’t displayed. If i call it  
without the AJAX, it works fine.

What can I do?

---

<div class="post-metadata">

**Author:** ![tktktk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a3d4f5/32.png) [@tktktk](https://www.ruby-forum.com/u/tktktk)\
**Post date:** [February 11, 2008, 10:57am UTC](https://www.ruby-forum.com/t/rich-text-editor-and-link-to-remote/128754/2 "2008-02-11T10:57:57Z")

</div>

i don’t know the YUI editor, but in principle the ajax call will not  
execute any code that’s needs events like onload. you could put that  
stuff into an init function and execute that with the ajax call:

render :update do |page|  
… your ‘normal’ ajax stuff …  
page.call “init\_function”  
end
