rails js.erb render partial code example
Example: render html in js.erb
$('#comments ul.comments').append("<%= j render(:partial => 'comments/foobar') %>");
$('#comments ul.comments').append("<%= j render(:partial => 'comments/foobar') %>");