Forum: Ruby on Rails Can I refresh a remotely updated section once?

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.
037e4140e0bd57b5bf5062904f5c34a3?d=identicon&s=25 Duane M. (dmorin)
on 2006-06-13 21:09
My object has_many Link objects.  So I've set up a form on my edit page
that uses form_remote to accept a text field and then dynamically create
and add a new Link object and remain on the same page.  I have a div
id="links" region that gets updated to show the current list of links.
This works fine.

But when I first load the page, if the object already had links, how do
I signal the links section to draw itself, before the form is submitted
for the first time?
If I just put some HTML code in that section I assume that it will be
rendered every time and I'll get redundant output.
Alex Wayne (Guest)
on 2006-06-14 00:50
Duane Morin wrote:
> My object has_many Link objects.  So I've set up a form on my edit page
> that uses form_remote to accept a text field and then dynamically create
> and add a new Link object and remain on the same page.  I have a div
> id="links" region that gets updated to show the current list of links.
> This works fine.
>
> But when I first load the page, if the object already had links, how do
> I signal the links section to draw itself, before the form is submitted
> for the first time?
> If I just put some HTML code in that section I assume that it will be
> rendered every time and I'll get redundant output.

A snippet of relevant code might help, because I don't think it's clear
what you are asking.
This topic is locked and can not be replied to.