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.
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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.