A simple question…
I want to add a child to an HTML element. In this case, the element is
“tbody” and the HTML is a row.
The insert_html method requires me to specify :after, :before, etc,
which in this case is not appropriate. The insert method in the new
version of prototype (1.6) allows you to specify just 2 parameters:
the id of the element and the content to add to it as a child.
Optionally, one can specify the position. The Insert.After,
Insert.Before, etc., are now deprecated (and this is what Rails is
What I ended up doing was something like:
page.call(“myAppendChild”, id, html_content), which is calling my own
js function and passing it a template rendered into a string – not
very clean I think.
Is there a way to append a child to an element from within Rails
without resorting to my js functions?