<% if (history.length) { %>
История поиска
<% for(var key in history) { %>
<%= history[key].from.name %>
<%= history[key].to.name %>
<% } %>
<% } %>