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--t1492252.html#a4043981 Sent from the RubyOnRails Users forum at Nabble.com.
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:> >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--t1492252.html#a4043981 >Sent from the RubyOnRails Users forum at Nabble.com. > >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >http://lists.rubyonrails.org/mailman/listinfo/rails_Kevin -- Posted with http://DevLists.com. Sign up and save your mailbox.
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--t1492252.html#a4044914 Sent from the RubyOnRails Users forum at Nabble.com.
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.