I have a problem rendering @resultsfrom show.js.erb. The result is as follows:
show.js.erb
$('#results').empty();
$('#results').html("<ul><%= escape_javascript(render(@results)).html_safe %></ul>");
_result.html.erb
<li>
<%= link_to(result.title, result.uri) %><br>
<span class="urls"><%= result.uri %></span>
</li>
Using _result.html.erbin show.html.erb:
<ul>
<%= render @results %>
</ul>
produces the correct conclusion.
The alleged offender <%= escape_javascript(render(@results)).html_safe %>. I tried <%= raw(escape_javascript(render@results)) %>but no luck. Application created with Rails 3.0.8.
Edit 1:
Longer version of show.js.erb :
$('#results').empty();
$('#results').html("<ul><%= escape_javascript(render(:partial => "results/result", :collection => @results)).html_safe %></ul>");
remains the same as in the image with a>, li>and something else.
Edit 2:
HTML displayed show.js.erb:

Edit 3:
<a href="http://jasonseifer.com/2010/04/06/rake-tutorial">Rake Tutorial | Jason Seifera><br> <span class="urls">http://jasonseifer.com/2010/04/06/rake-tutorialspan>li></span></a>
Change 4:
without html_safe:
$('#results').empty();
$('#results').html('<ul><%= escape_javascript render(@results) %></ul>');
Conclusion:

</already have it escape_javascript.
Edit 5: It works! At last!
$('#results').html('<%= escape_javascript("<ul>#{render(@results)}</ul>").html_safe %>');
Dogbert .html('') .html_safe.