Forum: Ruby on Rails AJAX and partial template rendering

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Bb4bdf2b184027bc38d4fb529770cde5?d=identicon&s=25 Wes Gamble (weyus)
on 2006-03-18 07:20
I was attempting to integrate a data grid component and ran into a

I needed to update the <DIV> around my data grid component, however, the
original code did not, so it was using Ajax.Request instead of
Ajax.Updater to do the Ajax call.

I thought that instead of using Ajax.Updater, I could simply leave the
Ajax.Request call, and just do a render (:partial => 'partial template
which basically held the <DIV> in question') instead.  However, this
didn't work.

Based on this, I am not sure that I understand how partial renders work.
If I make an Ajax call using Ajax.Request (such that no dynamic client
side updating is expected) and in the controller method that I call, I
do a render (:partial => 'whatever'), should I expect that the partial
rendering will appear in the browser or not?

Put another way, is it in any way reasonable for me to think that
Ajax.Request + partial render of "div" in the Ajax controller target is
equivalent to Ajax.Updater('DIV', ...)

If not, why not?

[ The thing that's very confusing to me is that the rendering is
necessary or the controller will complain, and it seemed like for
certain request to render other pages (not my original partial), that
the rendering would happen. ]

Is the only way to update the browser based on an Ajax call to
manipulate the innerHTML of some HTML tag using Javascript?

Thanks for any help,
This topic is locked and can not be replied to.