RE: RJS replace_html auto-closing tags


Maybe you can try:

html = ‘

@projects.each do |p|
html << ‘results’ << << ‘

html << ‘searchresults’ << ‘

page.replace_html ‘results’, html

Something like that.



I think both options are pretty awkward.

Put the stuff in a partial and do a replace with :partial render option.

Ed Frederick –


Oh, and use replace, not replace_html.

The first div wasn’t added for you, its just that it’s ‘still there’
because you’re just replacing the innards.