# Rjs woes, any hints?

**URL:** <https://www.ruby-forum.com/t/rjs-woes-any-hints/58536>\
**Category:** Rails\
**Created:** [April 22, 2006, 9:08pm UTC](https://www.ruby-forum.com/t/rjs-woes-any-hints/58536 "2006-04-22T21:08:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cwd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/da6949/32.png) [@cwd](https://www.ruby-forum.com/u/cwd)\
**Post date:** [April 22, 2006, 9:08pm UTC](https://www.ruby-forum.com/t/rjs-woes-any-hints/58536/1 "2006-04-22T21:08:39Z")

</div>

I’ve pared my rjs experiment down to what seems a bare minimum. When I  
click  
on my link\_to\_remote, the rjs executes, returns the correct javascript  
to  
the browser, but it doesn’t update the div I’ve specified. What appears  
to  
be coming back from the controller is:

Element.update(“my\_form”, “hello, rjs”);

I’m tearing my hair out. Here’s the code (any help is much appreciated):

–post\_controller.rb–

def new  
end

–new.rjs–  
page.replace\_html ‘my\_form’, ‘hello, rjs’

–list.rhtml–

\<%= link\_to\_remote('+', :url =\> {:action =\> 'new'}) %\>

---------------

–  
View this message in context:  
[http://www.nabble.com/rjs-woes%2C-any-hints--t1492252.html#a4043981](http://www.nabble.com/rjs-woes%2C-any-hints--t1492252.html#a4043981)  
Sent from the RubyOnRails Users forum at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![cwd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/da6949/32.png) [@cwd](https://www.ruby-forum.com/u/cwd)\
**Post date:** [April 22, 2006, 10:23pm UTC](https://www.ruby-forum.com/t/rjs-woes-any-hints/58536/2 "2006-04-22T22:23:15Z")

</div>

Have you included the appropriate javascript files in the headers of  
your layout?

On Saturday, April 22, 2006, at 12:06 PM, s.ross wrote:

> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

\_Kevin

---

<div class="post-metadata">

**Author:** ![cwd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/da6949/32.png) [@cwd](https://www.ruby-forum.com/u/cwd)\
**Post date:** [April 22, 2006, 10:35pm UTC](https://www.ruby-forum.com/t/rjs-woes-any-hints/58536/3 "2006-04-22T22:35:42Z")

</div>

I included:

## I expect not all of these are necessary, but that’s what I currently have.

View this message in context:  
[http://www.nabble.com/rjs-woes%2C-any-hints--t1492252.html#a4044914](http://www.nabble.com/rjs-woes%2C-any-hints--t1492252.html#a4044914)  
Sent from the RubyOnRails Users forum at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![cwd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/da6949/32.png) [@cwd](https://www.ruby-forum.com/u/cwd)\
**Post date:** [April 23, 2006, 1:45am UTC](https://www.ruby-forum.com/t/rjs-woes-any-hints/58536/4 "2006-04-23T01:45:59Z")

</div>

I’ve pared this back even further and discovered something strange  
happens. I  
created a new rails app and got rjs working fine. I ported exactly that  
functionality back to my main dev tree, ran rake  
rails:update:javascripts  
and the working code from the fresh test app fails in the real app.

## I’ve verified that the javascripts are the same release. The XHTML validates, the CSS validates… Is there any other factor that might shed some light on this?

View this message in context:  
[http://www.nabble.com/rjs-woes%2C-any-hints--t1492252.html#a4046449](http://www.nabble.com/rjs-woes%2C-any-hints--t1492252.html#a4046449)  
Sent from the RubyOnRails Users forum at [Nabble.com](http://Nabble.com).
