reuben.m-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jan-29 04:00 UTC
replace_html and Prototype
''m trying to change over from Rails 1.1.6 to 1.2.1 and have discovered that either something is wrong with Prototype of else something has changed that I am not aware of and cannot find documentation on. (I just joined this group, so if this has already been cussed and discussed here or in another list then please point me in the right direction.) I posted this to the Spinoffs group since it seemed to be more focused on javascript, but didn''t get any replys. I still haven''t been able to figure out what is going on so I''m reposting it here: ===Origional Message== I am trying to use the "replace_html" feature, and instead of prototype processing the generated javascript, I get a big load of "try {Element.update( ...lots of javascript garbage... ) throw e }" dumped onto my screen in place of where the updated html should be. I encountered the same problem when I tried to work around it by using "replace" to swap out the whole element with updated innerHTML. The only way I could get around this problem was to use "replace" while changing the element id every time. (Which results in more code than should be necessary) Basically, whenever I try to update an element, the javascript doesn''t get picked up by prototype unless the id of the target element gets changed in the process. Is this a bug or am I completely missing something here? I''ve only been using Rails for a couple months now, so I''m a bit new at this... Thanks, -Reuben --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi, after updating to 1.2.1, did you run ''rake rails:update'' after changing the version to 1.2.1 in the environment.rb? -Conrad On 1/28/07, reuben.m-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <reuben.m-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > ''m trying to change over from Rails 1.1.6 to 1.2.1 and have discovered > that either something is wrong with Prototype of else something has > changed that I am not aware of and cannot find documentation on. (I > just joined this group, so if this has already been cussed and > discussed here or in another list then please point me in the right > direction.) > > I posted this to the Spinoffs group since it seemed to be more focused > on javascript, but didn''t get any replys. I still haven''t been able to > figure out what is going on so I''m reposting it here: > > ===Origional Message==> > I am trying to use the "replace_html" feature, and instead of > prototype > processing the generated javascript, I get a big load of "try > {Element.update( ...lots of javascript garbage... ) throw e }" dumped > onto my screen in place of where the updated html should be. > > I encountered the same problem when I tried to work around it by using > "replace" to swap out the whole element with updated innerHTML. The > only way I could get around this problem was to use "replace" while > changing the element id every time. (Which results in more code than > should be necessary) > > Basically, whenever I try to update an element, the javascript doesn''t > get picked up by prototype unless the id of the target element gets > changed in the process. > > Is this a bug or am I completely missing something here? I''ve only > been > using Rails for a couple months now, so I''m a bit new at this... > > Thanks, > -Reuben > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
reuben.m-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Feb-03 02:20 UTC
Re: replace_html and Prototype
Sorry for the late reply, I''ve been gone. Yes, I had already done that. There were finally some replies to the origional post for this problem that I posted to the Spinoffs list, and apparently I''m not the only one running into this problem. -Reuben On Jan 28, 11:10 pm, "Conrad Taylor" <conra...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, after updating to 1.2.1, did you run ''rake rails:update'' after > changing the version to 1.2.1 in the environment.rb? > > -Conrad > > On 1/28/07, reube...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <reube...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > ''m trying to change over from Rails 1.1.6 to 1.2.1 and have discovered > > that either something is wrong with Prototype of else something has > > changed that I am not aware of and cannot find documentation on. (I > > just joined this group, so if this has already been cussed and > > discussed here or in another list then please point me in the right > > direction.) > > > I posted this to the Spinoffs group since it seemed to be more focused > > on javascript, but didn''t get any replys. I still haven''t been able to > > figure out what is going on so I''m reposting it here: > > > ===Origional Message==> > > I am trying to use the "replace_html" feature, and instead of > > prototype > > processing the generated javascript, I get a big load of "try > > {Element.update( ...lots of javascript garbage... ) throw e }" dumped > > onto my screen in place of where the updated html should be. > > > I encountered the same problem when I tried to work around it by using > > "replace" to swap out the whole element with updated innerHTML. The > > only way I could get around this problem was to use "replace" while > > changing the element id every time. (Which results in more code than > > should be necessary) > > > Basically, whenever I try to update an element, the javascript doesn''t > > get picked up by prototype unless the id of the target element gets > > changed in the process. > > > Is this a bug or am I completely missing something here? I''ve only > > been > > using Rails for a couple months now, so I''m a bit new at this... > > > Thanks, > > -Reuben--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
mcintyre.tim-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Feb-03 02:44 UTC
Re: replace_html and Prototype
I strongly suspect your using the :update option on your remote call??? I commented on this in another post, here is my comment from that post:> on main.rhtml, I have: > <%= link_to_remote(''add'', :url=>{:action=>''openAdd''}, > :update=>''addZone'')-%> # don''t use :update for rjs calls > <div id="addZone"></div>Don''t use the :update option with rjs calls. That constructs an Ajax.Updater prototype object instead of the Ajax.Request object you need for rjs calls. On the other hand, if you only need to update one html element, I''d leave the :update option and just return a regular partial template, pretty sure it''s considerably faster. Good Luck, Tim On Jan 28, 8:00 pm, "reube...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <reube...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> ''m trying to change over from Rails 1.1.6 to 1.2.1 and have discovered > that either something is wrong with Prototype of else something has > changed that I am not aware of and cannot find documentation on. (I > just joined this group, so if this has already been cussed and > discussed here or in another list then please point me in the right > direction.) > > I posted this to the Spinoffs group since it seemed to be more focused > on javascript, but didn''t get any replys. I still haven''t been able to > figure out what is going on so I''m reposting it here: > > ===Origional Message==> > I am trying to use the "replace_html" feature, and instead of > prototype > processing the generated javascript, I get a big load of "try > {Element.update( ...lots of javascript garbage... ) throw e }" dumped > onto my screen in place of where the updated html should be. > > I encountered the same problem when I tried to work around it by using > "replace" to swap out the whole element with updated innerHTML. The > only way I could get around this problem was to use "replace" while > changing the element id every time. (Which results in more code than > should be necessary) > > Basically, whenever I try to update an element, the javascript doesn''t > get picked up by prototype unless the id of the target element gets > changed in the process. > > Is this a bug or am I completely missing something here? I''ve only > been > using Rails for a couple months now, so I''m a bit new at this... > > Thanks, > -Reuben--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
reuben.m-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Feb-03 16:57 UTC
Re: replace_html and Prototype
Yes, I was using the :update option. However, I had already changed it to the new in-line format using update_page do |page| ... end Do I need to go back to using and RJS template if I get rid of the :update option? On Feb 2, 8:44 pm, mcintyre....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> I strongly suspect your using the :update option on your remote > call??? > > I commented on this in another post, here is my comment from that > post: > > > on main.rhtml, I have: > > <%= link_to_remote(''add'', :url=>{:action=>''openAdd''}, > > :update=>''addZone'')-%> # don''t use :update for rjs calls > > <div id="addZone"></div> > > Don''t use the :update option with rjs calls. That constructs an > Ajax.Updater prototype object instead of the Ajax.Request object you > need for rjs calls. > > On the other hand, if you only need to update one html element, I''d > leave the :update option and just return a regular partial template, > pretty sure it''s considerably faster. > > Good Luck, > Tim > > On Jan 28, 8:00 pm, "reube...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <reube...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > ''m trying to change over from Rails 1.1.6 to 1.2.1 and have discovered > > that either something is wrong with Prototype of else something has > > changed that I am not aware of and cannot find documentation on. (I > > just joined this group, so if this has already been cussed and > > discussed here or in another list then please point me in the right > > direction.) > > > I posted this to the Spinoffs group since it seemed to be more focused > > on javascript, but didn''t get any replys. I still haven''t been able to > > figure out what is going on so I''m reposting it here: > > > ===Origional Message==> > > I am trying to use the "replace_html" feature, and instead of > > prototype > > processing the generated javascript, I get a big load of "try > > {Element.update( ...lots of javascript garbage... ) throw e }" dumped > > onto my screen in place of where the updated html should be. > > > I encountered the same problem when I tried to work around it by using > > "replace" to swap out the whole element with updated innerHTML. The > > only way I could get around this problem was to use "replace" while > > changing the element id every time. (Which results in more code than > > should be necessary) > > > Basically, whenever I try to update an element, the javascript doesn''t > > get picked up by prototype unless the id of the target element gets > > changed in the process. > > > Is this a bug or am I completely missing something here? I''ve only > > been > > using Rails for a couple months now, so I''m a bit new at this... > > > Thanks, > > -Reuben--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
mcintyre.tim-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Feb-03 19:25 UTC
Re: replace_html and Prototype
The in-line format is exactly the same as using a template, it just gives you a way to in-line :-) instead of having to create a new file when you only need to write a couple lines. If you use the :update option simply return regular old text/html (e.g. a partial). Without the :update option you need to return javascript which is where rjs, including the in-line form, comes in. Tim On Feb 3, 8:57 am, "reube...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <reube...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Yes, I was using the :update option. However, I had already changed it > to the new in-line format using > > update_page do |page| > ... > end > > Do I need to go back to using and RJS template if I get rid of > the :update option? > > On Feb 2, 8:44 pm, mcintyre....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote: > > > I strongly suspect your using the :update option on your remote > > call??? > > > I commented on this in another post, here is my comment from that > > post: > > > > on main.rhtml, I have: > > > <%= link_to_remote(''add'', :url=>{:action=>''openAdd''}, > > > :update=>''addZone'')-%> # don''t use :update for rjs calls > > > <div id="addZone"></div> > > > Don''t use the :update option with rjs calls. That constructs an > > Ajax.Updater prototype object instead of the Ajax.Request object you > > need for rjs calls. > > > On the other hand, if you only need to update one html element, I''d > > leave the :update option and just return a regular partial template, > > pretty sure it''s considerably faster. > > > Good Luck, > > Tim > > > On Jan 28, 8:00 pm, "reube...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <reube...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > ''m trying to change over from Rails 1.1.6 to 1.2.1 and have discovered > > > that either something is wrong with Prototype of else something has > > > changed that I am not aware of and cannot find documentation on. (I > > > just joined this group, so if this has already been cussed and > > > discussed here or in another list then please point me in the right > > > direction.) > > > > I posted this to the Spinoffs group since it seemed to be more focused > > > on javascript, but didn''t get any replys. I still haven''t been able to > > > figure out what is going on so I''m reposting it here: > > > > ===Origional Message==> > > > I am trying to use the "replace_html" feature, and instead of > > > prototype > > > processing the generated javascript, I get a big load of "try > > > {Element.update( ...lots of javascript garbage... ) throw e }" dumped > > > onto my screen in place of where the updated html should be. > > > > I encountered the same problem when I tried to work around it by using > > > "replace" to swap out the whole element with updated innerHTML. The > > > only way I could get around this problem was to use "replace" while > > > changing the element id every time. (Which results in more code than > > > should be necessary) > > > > Basically, whenever I try to update an element, the javascript doesn''t > > > get picked up by prototype unless the id of the target element gets > > > changed in the process. > > > > Is this a bug or am I completely missing something here? I''ve only > > > been > > > using Rails for a couple months now, so I''m a bit new at this... > > > > Thanks, > > > -Reuben--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
reuben.m-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Feb-06 02:38 UTC
Re: replace_html and Prototype
That fixed my problem. Thanks for the help. -Reuben On Feb 3, 1:25 pm, mcintyre....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> The in-line format is exactly the same as using a template, it just > gives you a way to in-line :-) instead of having to create a new file > when you only need to write a couple lines. > > If you use the :update option simply return regular old text/html > (e.g. a partial). Without the :update option you need to return > javascript which is where rjs, including the in-line form, comes in. > > Tim > > On Feb 3, 8:57 am, "reube...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <reube...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Yes, I was using the :update option. However, I had already changed it > > to the new in-line format using > > > update_page do |page| > > ... > > end > > > Do I need to go back to using and RJS template if I get rid of > > the :update option? > > > On Feb 2, 8:44 pm, mcintyre....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote: > > > > I strongly suspect your using the :update option on your remote > > > call??? > > > > I commented on this in another post, here is my comment from that > > > post: > > > > > on main.rhtml, I have: > > > > <%= link_to_remote(''add'', :url=>{:action=>''openAdd''}, > > > > :update=>''addZone'')-%> # don''t use :update for rjs calls > > > > <div id="addZone"></div> > > > > Don''t use the :update option with rjs calls. That constructs an > > > Ajax.Updater prototype object instead of the Ajax.Request object you > > > need for rjs calls. > > > > On the other hand, if you only need to update one html element, I''d > > > leave the :update option and just return a regular partial template, > > > pretty sure it''s considerably faster. > > > > Good Luck, > > > Tim > > > > On Jan 28, 8:00 pm, "reube...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <reube...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > ''m trying to change over from Rails 1.1.6 to 1.2.1 and have discovered > > > > that either something is wrong with Prototype of else something has > > > > changed that I am not aware of and cannot find documentation on. (I > > > > just joined this group, so if this has already been cussed and > > > > discussed here or in another list then please point me in the right > > > > direction.) > > > > > I posted this to the Spinoffs group since it seemed to be more focused > > > > on javascript, but didn''t get any replys. I still haven''t been able to > > > > figure out what is going on so I''m reposting it here: > > > > > ===Origional Message==> > > > > I am trying to use the "replace_html" feature, and instead of > > > > prototype > > > > processing the generated javascript, I get a big load of "try > > > > {Element.update( ...lots of javascript garbage... ) throw e }" dumped > > > > onto my screen in place of where the updated html should be. > > > > > I encountered the same problem when I tried to work around it by using > > > > "replace" to swap out the whole element with updated innerHTML. The > > > > only way I could get around this problem was to use "replace" while > > > > changing the element id every time. (Which results in more code than > > > > should be necessary) > > > > > Basically, whenever I try to update an element, the javascript doesn''t > > > > get picked up by prototype unless the id of the target element gets > > > > changed in the process. > > > > > Is this a bug or am I completely missing something here? I''ve only > > > > been > > > > using Rails for a couple months now, so I''m a bit new at this... > > > > > Thanks, > > > > -Reuben--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---