Forum: Ruby on Rails AJAX and partial template rendering

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Wes G. (Guest)
on 2006-03-18 08:20
I was attempting to integrate a data grid component and ran into a
problem.

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,
Wes
This topic is locked and can not be replied to.