RE: RJS replace_html auto-closing tags


#1

Maybe you can try:

html = ‘


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

end
html << ‘searchresults’ << ‘

page.replace_html ‘results’, html

Something like that.

Chris


#2

I think both options are pretty awkward.

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

Ed Frederick – edwardfrederick.com


#3

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.