Ajax makes me cry

What is the difference in treatment between an ajax link_to_remote and a
form_remote_tag

This works great and adds a list item to an ordered list with
id=form_results

link_to_remote (“Help me please!”,
:update => ‘form_results’,
:url => { :action => :search_ajax_test },
:position => ‘bottom’)

with this log message

Processing AdminController#search_ajax_test (for 192.168.15.100 at
2006-01-03 21:35:43) [POST]
Parameters: {“action”=>“search_ajax_test”, “controller”=>“admin”}
Completed in 0.00079 (1272 reqs/sec) | DB: 0.00000 (0%) | 200 OK
[http://192.168.15.50/admin/search_ajax_test]

This does absolutely nothing at all

form_remote_tag ( :udpate => ‘form_results’,
:url => { :action => :search_ajax_test },
:position => ‘bottom’)
…some stuff…
end_form_tag

but still produces this log message

Processing AdminController#search_ajax_test (for 192.168.15.100 at
2006-01-03 21:35:46) [POST]
Parameters: {“commit”=>“Search”, “action”=>“search_ajax_test”,
“controller”=>“admin”, “query”=>“asdf”}
Completed in 0.00077 (1291 reqs/sec) | DB: 0.00000 (0%) | 200 OK
[http://192.168.15.50/admin/search_ajax_test]

Can anyone tell me why the form call does nothing at all?

Thanks

On 1/4/06, John R. [email protected] wrote:

What is the difference in treatment between an ajax link_to_remote and a
form_remote_tag

The former generates a tag and the latter generates a which
sends
post data asynchronously after serializing it in url encoded
form.Bothreturn html which is inserted into the html noe whose id is
in :update

but still produces this log message

Thanks

It would be better if you post the generated html because the code in
your
view looks ok.Besides are actually returning any html in your controller
action? is there a call to a render ? Whatever is returned by render
will
be inserted into the ‘form_results’ node.
Vivek

John R. wrote:

form_remote_tag ( :udpate => ‘form_results’,
Thanks

update, not udpate, lol.

Ben H. wrote:

form_remote_tag ( :udpate => ‘form_results’,
Thanks

update, not udpate, lol.

AAAAAAAAAAAHHHHHHHHHHHHHHHHH!!!

You are my hero. Thank you so much.

John R. wrote:

Ben H. wrote:

form_remote_tag ( :udpate => ‘form_results’,
Thanks

update, not udpate, lol.

AAAAAAAAAAAHHHHHHHHHHHHHHHHH!!!

You are my hero. Thank you so much.

After calming down a little bit, shouldn’t this have thrown some kind of
error? What good is a *remote call with no update ( or udpate )
assigned. Is there a way to turn on strict checking or something?
Anything more helpful than apparent success? Thanks again.

For two situations:

  1. for .rjs templates, you don’t do :update
  2. if you handle the data return somehow yourself, with a :complete
    => ‘…’ JavaScript callback

-Thomas

Am 04.01.2006 um 13:51 schrieb John R.:

On 1/4/06, John R. [email protected] wrote:

Ben H. wrote:

form_remote_tag ( :udpate => ‘form_results’,
Thanks

update, not udpate, lol.

AAAAAAAAAAAHHHHHHHHHHHHHHHHH!!!

ooops…missed that!! this uses the named parameter syntax of ruby and
not
the hash way of passing params…so it should give an error…or probably
ruby ignores it ?