I''m developing on my Mac OS X Powerbook using just Mongrel. I''ve been trying to get the simplest of RJS to work: # view <div id="test">ruby</div> link_to_remote ''update'', :url=>{:action=>:doit} # controller def doit render :update do |page| page.replace_html(''test'', ''rails'') # page[''test''].replace_html(''rails'') # doesn''t work either # page[''test''].value = ''rails'' # doesn''t work either # page.hide ''test'' # doesn''t work either # bunch of other RJS attempts that don''t work... end end Am I missing something? The link appears to work, as clicking it shows up in the log. I have no idea why it''s not working, unless maybe it''s a Mongrel-only thing (as opposed to using Mongrel and Lighty) -- but that''s a shot in the dark. Or maybe it''s related to using controller modules? If I add ":update=>''test''" to the link tag, the div gets changed to "Element.update("test", "rails");" or "$(''test'').value=''rails''" or whatever. I''ve restarted Mongrel many times, tried it in Safari, refreshed, checked my javascript settings (it does seem like the javascript isn''t getting run for some reason), etc. -- all to no avail. Anybody have ANY idea what the problem might be? I''m getting cross-eyed... Thanks, Joe -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Joe Ruby MUDCRAP-CE wrote:> I''m developing on my Mac OS X Powerbook using just Mongrel. I''ve been > trying to get the simplest of RJS to work: > > > # view > <div id="test">ruby</div> > > link_to_remote ''update'', :url=>{:action=>:doit} > > > # controller > def doit > render :update do |page| > page.replace_html(''test'', ''rails'') > # page[''test''].replace_html(''rails'') # doesn''t work either > # page[''test''].value = ''rails'' # doesn''t work either > # page.hide ''test'' # doesn''t work either > # bunch of other RJS attempts that don''t work... > end > end > > > Am I missing something? The link appears to work, as clicking it shows > up in the log. I have no idea why it''s not working, unless maybe it''s a > Mongrel-only thing (as opposed to using Mongrel and Lighty) -- but > that''s a shot in the dark. Or maybe it''s related to using controller > modules? If I add ":update=>''test''" to the link tag, the div gets > changed to "Element.update("test", "rails");" or > "$(''test'').value=''rails''" or whatever. I''ve restarted Mongrel many > times, tried it in Safari, refreshed, checked my javascript settings (it > does seem like the javascript isn''t getting run for some reason), etc. > -- all to no avail. Anybody have ANY idea what the problem might be? I''m > getting cross-eyed... > > Thanks, > Joe > > -- > Posted via http://www.ruby-forum.com/.Sounds like you forgot to put... <%= javascript_include_tag :defaults %> in the head of your layout file. _Kevin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
_Kevin wrote:> > Sounds like you forgot to put... > > <%= javascript_include_tag :defaults %> > > in the head of your layout file.Nope, it''s there (link_to_remote wouldn''t work otherwise, if I''m not mistaken). Joe -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
I''d get a copy of the firebug extension for firefox and see what the AJAX request/response looks like. _Kevin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
_Kevin wrote:> I''d get a copy of the firebug extension for firefox and see what the > AJAX request/response looks like. > > _KevinI wasn''t aware of that extension -- might come in handy in the future. :) I tried one other thing I hadn''t thought of -- ''rake rails:update:javascripts'' -- and now RJS works! I installed Rails on this computer not too long ago (certainly after 1.1) -- you''d think the javascripts would be up to date. Wonder what the deal was... Joe -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---