I am trying to make a render :update work, and couldn't find anything on the forums or in books on what I am doing wrong:
def index render :update do |page| page.replace_html 'asection', :text => '99' (or :partial => 'somepartial' etc.) end end
this never works. Instead, the javascript is rendered on the page - perhaps because it failed? - instead of the result of the execution itself. Once, an alert was actually popped up (so it did execute in one case, but failed). In most cases, nothing happens other than the replacement of the element by the javascript code, which looks something like:
try { Element.update("asection", "99\n"); } catch (e) { alert('RJS error:\n\n' + e.toString()); alert('Element.update(\"asection\", \"99\\n\");'); throw e }
replacing <div id='asection'> replace me </div>
the following always works, I don't have a problem with basic partials:
def index render :partial => 'somepartial' end
in both cases, the controller is called from a periodically_call_remote statement
What am I doing wrong? Thanks in advance for any assistance.