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
--
Posted via http://www.ruby-forum.com/.
On 1/4/06, John Russell <jjrussell@gmail.com> wrote:> > What is the difference in treatment between an ajax link_to_remote and a > form_remote_tagThe former generates a <a> tag and the latter generates a <form> 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> > > 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? > > ThanksIt 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 --> Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060104/285debcc/attachment-0001.html
John Russell wrote:> form_remote_tag ( :udpate => ''form_results'', > Thanksupdate, not udpate, lol. -- Posted via http://www.ruby-forum.com/.
Ben Hiller wrote:>> form_remote_tag ( :udpate => ''form_results'', >> Thanks > > update, not udpate, lol.AAAAAAAAAAAHHHHHHHHHHHHHHHHH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! You are my hero. Thank you so much. -- Posted via http://www.ruby-forum.com/.
John Russell wrote:> Ben Hiller 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. -- Posted via http://www.ruby-forum.com/.
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 Russell:> What good is a *remote call with no update assigned. Is there a > way to turn on strict checking or something?
On 1/4/06, John Russell <jjrussell@gmail.com> wrote:> > Ben Hiller 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 ? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060104/e9ede64b/attachment.html