papaSnowShoveler
2007-Aug-17 02:36 UTC
Error when updating to prototype 1.5.1.1 and scriptaculous 1.7.1 beta3 with page.replace
I need a little help please. A newbie on rails, not much experience with java. My rails app worked fine and I upgraded to the latest prototype and scriptaculous for a plugin only to break another part of the app. I''m using rjs to replace a partial on my page. It used to work fine, but now when it replaces it, it shows up on the web page as try { Element.update("close_goal", "\n"); } catch (e) { alert(''RJS error:\n\n'' + e.toString()); alert(''Element.update(\"close_goal\", \"\\n\") ;''); throw e } in place of the html that should be there. here''s the partial <%unless @pending_close_goals.nil? %> <div class="pending_close_goal"> The last scheduled task was completed. Would you like to mark the goal complete?<br> <%#for pending in @pending_close_goals %> <%=@pending_close_goals.summary %>   -   <%=link_to_remote "Mark Complete", :url=>{:controller=> ''schedule'', :action=> ''mark_complete'', :id=>@pending_close_goals.id}, :update=>''close_goal'' %>   <%=link_to_remote "NO", :url=>{:controller=> ''schedule'', :action=> ''not_mark_complete'', :method=> :post}, :update=> ''close_goal'' %> <br> <%#end %> </div> <%end%> there''s some sortable lists with checkboxes that, when checked, will change the count of the @pending_close_goals variable. When one is checked, this part of the page gets reloaded as well as the sortable list. That part works ok. When you click on one of the links in the partial, it will complete the action, but, when it replaces the partial , it throws in that funky java text instead of rendering it. (I rolled back all the changes I made and got to the last working version, which worked fine, then updated those .js files and then it broke!) here''s the mark_complete.rjs page.replace_html ''close_goal'', :partial => ''close_goal'' and the not_mark_compete.rjs looks like: page.replace_html ''close_goal'', :partial => ''close_goal'' I''m including the standard js libraries using the <%= javascript_include_tag :defaults %> statement. If anyone could shed some light on what''s going wrong, that would be greatly appreciated. Again, it worked fine on the old versions of those libraries (whatever came with rails 1.2.3) Thank you in advance :) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
papaSnowShoveler
2007-Aug-18 02:40 UTC
Re: Error when updating to prototype 1.5.1.1 and scriptaculous 1.7.1 beta3 with page.replace
On Aug 16, 10:36 pm, papaSnowShoveler <acp...-H+0wwilmMs3R7s880joybQ@public.gmane.org> wrote:> I need a little help please. A newbie on rails, not much experience > with java. My rails app worked fine and I upgraded to the latest > prototype and scriptaculous for a plugin only to break another part of > the app. > > I''m using rjs to replace a partial on my page. It used to work fine, > but now when it replaces it, it shows up on the web page as > > try { > > Element.update("close_goal", "\n"); > > } catch (e) { alert(''RJS error:\n\n'' + e.toString()); > > alert(''Element.update(\"close_goal\", \"\\n\") > > ;''); throw e } > > in place of the html that should be there. >This is what was posted when using prototype 1.5.0rc2: (which rendered fine) try { Element.update("close_goal", "\n\n"); } catch (e) { alert(''RJS error:\n\n'' + e.toString()); alert(''Element.update(\"close_goal\", \"\\n\\n \");''); throw e } Notice that it was passing "\n\n" instead of just one \n. Is that part of the reason it is being shown as text, and not just rendered? Any insight would be greatly appreciated. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
papaSnowShoveler
2007-Aug-19 02:25 UTC
Re: Error when updating to prototype 1.5.1.1 and scriptaculous 1.7.1 beta3 with page.replace
Ok, I finally figured it out. Two things were conflicting it seems (at least removing one fixed it!) removing the :update=> ''close_goal'' fixed it. It now renders the javascript generated via the .rjs file which is page.replace_html ''close_goal'', :partial => ''close_goal'' So, prototype 1.5.0rc2 let this go, but the 1.5.1.1 won''t ignore it and gets all tripped up! I guess its just making me a better coder! I hope someone can benefit from this too! Consider this discussion closed Thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---