# Odd replace\_html outcome

**URL:** <https://www.ruby-forum.com/t/odd-replace-html-outcome/149427>\
**Category:** Rails\
**Created:** [September 24, 2008, 7:31pm UTC](https://www.ruby-forum.com/t/odd-replace-html-outcome/149427 "2008-09-24T19:31:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [September 24, 2008, 7:31pm UTC](https://www.ruby-forum.com/t/odd-replace-html-outcome/149427/1 "2008-09-24T19:31:39Z")

</div>

In my controller I have a simple “create” method and in the output  
section, I have:

```
  format.js do
    @traces = Trace.getLatest
    render :update do |page|
      page.visual_effect :highlight, :homeContentPanel
      page.replace_html :homeContentPanel, :partial => "home/

```

traceList", :locals =\> { :traces =\> @traces}, :layout =\> false  
end  
end

The intent is to, of course, simply updated a div “homeContentPanel”  
with the results of a partial. The partial that is _normally_ a part  
of the div anyway.

What I get is a completely odd formatted output. A sample is below.

Try { new Effect.Highlight(“homeContentPanel”,{});  
Element.update(“homeContentPanel”, "  
\n \n Time\n Description\n Date Entered

It’s as if it’s in debug mode.

Thoughts?

---

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [September 24, 2008, 7:36pm UTC](https://www.ruby-forum.com/t/odd-replace-html-outcome/149427/2 "2008-09-24T19:36:22Z")

</div>

On 24 Sep 2008, at 18:30, sullivan.t wrote:

> ```
> end
> end
> 
> ```
> 
> The intent is to, of course, simply updated a div “homeContentPanel”  
> with the results of a partial. The partial that is _normally_ a part  
> of the div anyway.

> What I get is a completely odd formatted output. A sample is below.
> 
> Try { new Effect.Highlight(“homeContentPanel”,{});  
> Element.update(“homeContentPanel”, "  
> \n \n Time\n Description\n Date Entered
> 
> It’s as if it’s in debug mode.
> 
> Thoughts?

Your link\_to\_remote, form\_remote\_tag etc… is using an :update option  
which means “stick the response from the server in this element” but  
you’re using a render :update block which means “generate some  
javascript to perform some changes”

Do one or the other, but not both.

Fred

---

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [September 24, 2008, 7:44pm UTC](https://www.ruby-forum.com/t/odd-replace-html-outcome/149427/3 "2008-09-24T19:44:39Z")

</div>

…oh… oh… right. I knew that. You passed.

Thanks a billion. 🙂

On Sep 24, 1:34 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
