var html = '';
<% if @results.any? %>
  <% @results.each do |match| %>
    html += '<%= j PostPresenter.preview(match[:post], :tags => "status:any") %>';
  <% end %>
<% else %>
  html += '<p>No matches found</p>';
<% end %>

$("<div></div>").html(html).dialog({title: "Similar Posts", modal: true, width: "600px"});
