Getting things to appear one at a time with ajax


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”

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?

Patrik Nisen


I am not sure that I understood your question correctly, but If you want
put result of request into div element then you should use :update
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.


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?