On Mar 20, 2006, at 7:49, Wes Gamble wrote:
> All,
>
> Trying to clear up some confusion on my part.
>
> If I make an Ajax call using Ajax.Request and in the controller method
> that I call, I do a render (:partial =>
''whatever.rhtml''), should I
> expect that ''whatever.rhtml'' will be rendered in the
browser or not?
>
> Put another way, is it in any way reasonable for me to think that
> Ajax.Request + partial render of "myDiv" in the Ajax controller
target
> is
> equivalent to Ajax.Updater(''myDiv'', ...)
"Partials" are a mean to build views in the server, they do not use
layouts, they follow some name conventions, etc., but they ultimately
generate the same content regular RHTML templates do.
You could implement Ajax stuff calling an action that renders a
regular RHTML template with :layout => false. No difference from the
user''s perspective.
Now for the Javascript, Ajax.Request does not update anything per se,
unless you do something by hand in the callbacks:
http://wiki.script.aculo.us/scriptaculous/show/Ajax.Request
It just issues a call to the server.
Additionally, one rarely writes those Javascript snippets by hand,
they are normally generated by helpers in Rails.
-- fxn