Forum: Ruby on Rails AJAX + Ruby on rails

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.
Naroor R. (Guest)
on 2005-12-09 12:33
Hi all ,
    I was trying the AJAX example given by Curt hibbs
(http://www.onlamp.com/pub/a/onlamp/2005/06/09/rail...) .In the
example it was putting a list item in the list .I tried adding a new
text box (input tag ) . I was successfull in adding the text boxes into
the table when the button was clicked .But I am in doubt on how can I
capture the contents of the text boxes and add those to my database
.Also when i took the view source of the page I can see that there is no
input tags or id values to be used.
 Please help me out in uunderstanding what will be the name/id of the
controls created by the form_remote_tag() .

Please help me out ,

Thanx and regards,
Naroor R.
krishna.vivek (Guest)
on 2005-12-09 13:15
(Received via mailing list)
On 12/9/05, naroor rathish <removed_email_address@domain.invalid> wrote:
>
> Hi all ,
>     I was trying the AJAX example given by Curt hibbs
> (http://www.onlamp.com/pub/a/onlamp/2005/06/09/rail...) .In the
> example it was putting a list item in the list .I tried adding a new
> text box (input tag ) . I was successfull in adding the text boxes into
> the table when the button was clicked .But I am in doubt on how can I
> capture the contents of the text boxes


Hi,
use the form_remote_tag's :update  parameter to indicate what DOM
element to
update and
and use its :url to decide what to call on ur server. I cant remember
the
exact syntax but it goes like this ..like a regular form except that the
form_remote uses Ajax.Updater to send the serialized form data.
the 'submit' method in your controller should update your database

<%form_remote_tag :update => 'someid' , :url => {:controller => 'form'
,:action =>'submit' } %>
<% text_field  "id"  "Enter Text" %>
<%submit "submit" %>
<%end_form_tag>

Read the docs..its pretty well explain there.
http://api.rubyonrails.com/classes/ActionView/Help...
Vivek
Naroor R. (Guest)
on 2005-12-09 13:23
Hi Vivek,
    Thanx for the reply.But I think my question is not clear .Please
visit the site http://blinksale.com/ and register for a free trial.When
you login you can see the JAX effect that I am trying to re create.
    Also The ajax please go through the ajax effect at
http://www.onlamp.com/pub/a/onlamp/2005/06/09/rail... .Both
using form_remote_tag() and link_to_remote() .I tried form_remote_tag()
.

Please let me know your ideas.

Thanx and regards,
Naroor R.
This topic is locked and can not be replied to.