RJS replace_html auto-closing tags


#1

I’m using the following RJS template to spit out a div containing a
list of projects:

page.replace_html ‘results’, ‘


@projects.each do |p|
page.insert_html :bottom, ‘results’, p.name + “

end
page.insert_html :bottom, ‘searchresults’, ‘

page.show ‘results’

However, it seems that my first like to insert the

tag
automatically sticks a
closing tag in as well. Is there any
way to avoid this, as I’d like the content from the loop to be
inserted into this div.

#2

However, it seems that my first like to insert the

tag
automatically sticks a
closing tag in as well. Is there any
way to avoid this, as I’d like the content from the loop to be
inserted into this div.

How about:

page.replace_html ‘results’, ‘


@projects.each do |p|
page.insert_html :bottom, ‘projectsresults’, p.name + “

end
page.show ‘results’