$("table.records").replaceWith("<%= escape_javascript(render('table', :collection => collection)) %>");