Forum: Ruby on Rails Getting things to appear one at a time with ajax.

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.
Patrik Nisen (Guest)
on 2005-11-21 21:46
I think it would be neat to make things got from database search to
appear one at a time using ajax and visual effects. The problem
naturally meets a beginner when it is time to implement this "great"
idea.

I have a form using "form_remote_tag" and ofcourse "text_field_tag" and
"submit_tag". I am currently able to render the results from the search
controller using "render :partial" , but it does not satisfy my needs :]

How is it possible(or is it?) to get these results appear on by one to a
certain div-element?

Thanks,
Patrik Nisen
anatol.pomozov (Guest)
on 2005-11-21 22:02
(Received via mailing list)
I am not sure that I understood your question correctly, but If you want
to
put result of request into div element then you should use :update
parameter
of form_remote_tag

something like this
<%= form_remote_tag :update => "updated_div", :url => {:action =>
"add_comment"} %>

See docs of form_remote_tag for more info.
Patrik Nisen <> (Guest)
on 2005-11-21 22:34
Thanks for your response.

Yes, thats what i am doing. "action"  is the search controller, which
locates stuff from the database using @params. Then i would like to put
the the search results to my div ("updated_div" in this case) so that
they appear one by one using visual effects.

Is this possible possible?
This topic is locked and can not be replied to.