I''m getting weird results using an Ajax call to render a partial. My RJS is getting executed properly as nearly as I can tell but instead of rendering the partial, it renders the Javascript that should be getting executed. Here''s what''s in the RJS file: page.insert_html :bottom, :product_div, :partial => ''test/ test_partial'' I tried a simpler test with: page.insert_html :bottom, :product_div, ''test'' but got similar results. The div element with id "product_div" gets updated with: try { new Insertion.Bottom("product_div", "test"); } catch (e) { alert(''RJS error:\n\n'' + e.toString()); alert(''new Insertion.Bottom(\"product_div\", \"test\");''); throw e Seems to me like this is the code that should be executed to put the word "test" in the div. The Prototype libraries seem to be loaded just fine and the Ajax call goes to the right place and executes properly - I just can''t see why it''s doing this. Any ideas on how to go about debugging this? Thanks! --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
On 2 Jul 2008, at 18:16, Matt White wrote:> > I''m getting weird results using an Ajax call to render a partial. My > RJS is getting executed properly as nearly as I can tell but instead > of rendering the partial, it renders the Javascript that should be > getting executed. Here''s what''s in the RJS file: > > page.insert_html :bottom, :product_div, :partial => ''test/ > test_partial'' > > I tried a simpler test with: > > page.insert_html :bottom, :product_div, ''test'' > > but got similar results. The div element with id "product_div" gets > updated with: > > try { new Insertion.Bottom("product_div", "test"); } catch (e) > { alert(''RJS error:\n\n'' + e.toString()); alert(''new > Insertion.Bottom(\"product_div\", \"test\");''); throw eHow are you invoking the ajax stuff ( ie are you using the :update option (if so, don''t) Fred> > > Seems to me like this is the code that should be executed to put the > word "test" in the div. The Prototype libraries seem to be loaded just > fine and the Ajax call goes to the right place and executes properly - > I just can''t see why it''s doing this. Any ideas on how to go about > debugging this? Thanks! > >--~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick, You''re a genius. Thanks, that was it. On Jul 2, 11:18 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 2 Jul 2008, at 18:16, Matt White wrote: > > > > > > > I''m getting weird results using an Ajax call to render a partial. My > > RJS is getting executed properly as nearly as I can tell but instead > > of rendering the partial, it renders the Javascript that should be > > getting executed. Here''s what''s in the RJS file: > > > page.insert_html :bottom, :product_div, :partial => ''test/ > > test_partial'' > > > I tried a simpler test with: > > > page.insert_html :bottom, :product_div, ''test'' > > > but got similar results. The div element with id "product_div" gets > > updated with: > > > try { new Insertion.Bottom("product_div", "test"); } catch (e) > > { alert(''RJS error:\n\n'' + e.toString()); alert(''new > > Insertion.Bottom(\"product_div\", \"test\");''); throw e > > How are you invoking the ajax stuff ( ie are you using the :update > option (if so, don''t) > > Fred > > > > > Seems to me like this is the code that should be executed to put the > > word "test" in the div. The Prototype libraries seem to be loaded just > > fine and the Ajax call goes to the right place and executes properly - > > I just can''t see why it''s doing this. Any ideas on how to go about > > debugging this? Thanks!--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---