aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2015-02-20 14:35:06 +0000
committerLouise Crow <louise.crow@gmail.com>2015-03-02 16:26:48 +0000
commit380116b4b49ebad449a1b260b6937f7de3cbb4de (patch)
tree5f37de654322007e4cfadcfb64d7ecdfb0962204
parentbf7fca93affaabdf90e516124c513925da4fca16 (diff)
Don't add any elements to page if there are no results.
-rw-r--r--app/views/request/_search_ahead.html.erb7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/views/request/_search_ahead.html.erb b/app/views/request/_search_ahead.html.erb
index c17c0b1ea..397973d49 100644
--- a/app/views/request/_search_ahead.html.erb
+++ b/app/views/request/_search_ahead.html.erb
@@ -1,6 +1,6 @@
<% unless @xapian_requests.nil? %>
+<% if @xapian_requests.results.any? %>
<div id="request_search_ahead_results">
- <% if @xapian_requests.results.any? %>
<span class="close-button">X</span>
<h2><%= _("Possible related requests") %></h2>
<% @xapian_requests.results.each do |result| %>
@@ -14,6 +14,7 @@
<%= _("Search in their website for this information &rarr;") %>
</a>
</p>
- <% end %>
- </div>
+
+ </div>
+ <% end %>
<% end %>