All I am trying to do is to put a different partial in place of the the once that is already there. Not an ajax call to the function.
On Feb 24, 12:32 pm, Chris Habgood <[email protected]> wrote: > Not an ajax call. Does it only work for an ajax call? > > On Tue, Feb 24, 2009 at 12:31 PM, Frederick Cheung < > > [email protected]> wrote: > > > On 24 Feb 2009, at 18:14, Me wrote: > > > > I have this div in my application.rhtml file: > > > > <div id="shelfcards"> <%= render :partial => 'ericssoncards' %></div> > > > > When I go to another view I am doing this: > > > > def turin2000 > > > render :update do |page| > > > page[:shelfcards].replace_html :partial => > > 'turin2000' > > > end > > > end > > > What does the think making the ajax request look like ? > > > Fred > > > I get this for an output: > > > > try { > > > $("shelfcards").update("<fieldset style='width: 400px;'> > > > \n<legend>Select your card type</legend>\n\n\t<div id='oc192' > > > class='card' >OC-192</div>\n\t<div id='oc48' \t\tclass='card' >OC-48</ > > > div>\n\t<div id='oc12' \t\tclass='card' >OC-12</div>\n\t<div id='oc3' > > > \t\tclass='card' >OC-3</div><br /><br />\n\t<div id='28pds1' > > > \tclass='card' >28P DS-1</div><br /><br />\n\t<div id='egcm' \t > > > \tclass='card' >EGCM</div><br /><br />\n\t<div id='gbeth' > > > \tclass='card' >GB ETH</div><br /><br />\n\t<div id='vt5g' \t > > > \tclass='card' >VT 5G</div><br /><br />\n</fieldset> \t\t"); > > > } catch (e) { alert('RJS error:\n\n' + e.toString()); alert('$ > > > (\"shelfcards\").update(\"<fieldset style=\'width: 400px;\'>\ > > > \n<legend>Select your card type</legend>\\n\\n\\t<div id=\'oc192\' > > > class=\'card\' >OC-192</div>\\n\\t<div id=\'oc48\' \\t\\tclass=\'card > > > \' >OC-48</div>\\n\\t<div id=\'oc12\' \\t\\tclass=\'card\' >OC-12</ > > > div> > > > \\n\\t<div id=\'oc3\' \\t\\tclass=\'card\' >OC-3</div><br /><br />\\n\ > > > \t<div id=\'28pds1\' \\tclass=\'card\' >28P DS-1</div><br /><br />\\n\ > > > \t<div id=\'egcm\' \\t\\tclass=\'card\' >EGCM</div><br /><br />\\n\ > > > \t<div id=\'gbeth\' \\tclass=\'card\' >GB ETH</div><br /><br />\\n\ > > > \t<div id=\'vt5g\' \\t\\tclass=\'card\' >VT 5G</div><br /><br />\\n</ > > > fieldset> \\t\\t\");'); throw e } > > > > If I put this partial inside the div manually it works fine. > > > > What causes this? > > --~--~---------~--~----~------------~-------~--~----~ 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

