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. -- Posted via http://www.ruby-forum.com/.
Alex Wayne
2006-Jun-13 22:50 UTC
[Rails] Re: Can I refresh a remotely updated section once?
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. -- Posted via http://www.ruby-forum.com/.