Rjs woes, any hints?


#1

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
Sent from the RubyOnRails Users forum at Nabble.com.


#2

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

_Kevin


#3

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
Sent from the RubyOnRails Users forum at Nabble.com.


#4

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
Sent from the RubyOnRails Users forum at Nabble.com.