Forum: Ruby on Rails Ajax response won't display

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.
Larry W. (Guest)
on 2006-04-27 16:04
(Received via mailing list)
I'm hopeful that this is something simple i'm missing, but I've run out
of
things to try.  It should work just like the example in Agile Web
Development with Rails (i think)

I send an ajax request using remote_form and it's processing correctly
on
the server and returning a new form, but it won't replace the original.
It's supposed to update a div with class="update".

Help would be REALLY appreciated.

This is my page (excluding layout that add the required javascript) and
some
surrounding html.
------------------------------------------------------------------------
 <div class="update">
    <%= render :partial => 'tab_predecessor_list' %>
 </div>
-------------------------------------------------------------------------
This is the partial "tab_predecessor_list"
---------------------------------------------------------------------
<%= form_remote_tag(:update => "update",
                                  :url => {:action =>
'add_predecessor'}) %>

    <span class="edit_label"><label
for="selected_task">Predecessor:</label></span>
    <input type="text" name="selected_task" >

    <%= Time.now.to_s %>

    <%= submit_tag "Add" %>
<%= end_form_tag %>
--------------------------------------------------------------------------
And this is the response I'm getting to the Ajax Request (from Firebug).
Note the timestamp. it doesn't update in my browser.

<form action="/tasks/add_predecessor" method="post" onsubmit="new
Ajax.Updater('update',
         '/tasks/add_predecessor', {asynchronous:true,
evalScripts:true, parameters:Form.serialize(this)}); return false;">

	<span class="edit_label"><label
for="selected_task">Predecessor:</label></span>
	<input type="text" name="selected_task" >

	Thu Apr 27 07:55:51 EDT 2006

	<input name="commit" type="submit" value="Add" />
</form>

-------------------------

I'm using firefox with Rails 1.0.  Thank you much in advance for your
help.
Larry W. (Guest)
on 2006-04-27 16:22
(Received via mailing list)
I got it.  I needed to use a div with ID="update" not class="update".
DOH.
Thanks
This topic is locked and can not be replied to.