Forum: Ruby on Rails rjs woes, any hints?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ef0db53920b243d6758c2f6b1306df0d?d=identicon&s=25 Steve Ross (cwd)
on 2006-04-22 21:08
(Received via mailing list)
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--
<p><%= link_to_remote('+', :url => {:action => 'new'}) %></p>

<div id="my_form"><!-- x --></div>
---------------

--
View this message in context:
http://www.nabble.com/rjs-woes%2C-any-hints--t1492...
Sent from the RubyOnRails Users forum at Nabble.com.
5d15c6821f3c3054c04b85471824ba7c?d=identicon&s=25 Kevin Olbrich (Guest)
on 2006-04-22 22:23
(Received via mailing list)
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:
>
>
>Rails@lists.rubyonrails.org
>http://lists.rubyonrails.org/mailman/listinfo/rails


_Kevin
Ef0db53920b243d6758c2f6b1306df0d?d=identicon&s=25 Steve Ross (cwd)
on 2006-04-22 22:35
(Received via mailing list)
I included:

<script src="/javascripts/prototype.js?1145730023"
type="text/javascript"></script>
<script src="/javascripts/effects.js?1145730023"
type="text/javascript"></script>
<script src="/javascripts/dragdrop.js?1145730023"
type="text/javascript"></script>
<script src="/javascripts/controls.js?1145730023"
type="text/javascript"></script>
<script src="/javascripts/application.js?1145730023"
type="text/javascript"></script>

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--t1492...
Sent from the RubyOnRails Users forum at Nabble.com.
Ef0db53920b243d6758c2f6b1306df0d?d=identicon&s=25 Steve Ross (cwd)
on 2006-04-23 01:45
(Received via mailing list)
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--t1492...
Sent from the RubyOnRails Users forum at Nabble.com.
This topic is locked and can not be replied to.