diff options
author | Gareth Rees <gareth@mysociety.org> | 2014-10-30 13:07:17 +0000 |
---|---|---|
committer | Gareth Rees <gareth@mysociety.org> | 2014-11-11 16:02:18 +0000 |
commit | 16762e7379ecd39d3a1e62ca6c7ddfc95914f7bc (patch) | |
tree | a5e33b9178b9f73fafe0e72dac06f38570a98889 | |
parent | 29552f13f7340875e519b1e017349cb3c6d705a6 (diff) |
Only attempt to render results if there are any
No point trying to render the results if there aren’t any to render
-rw-r--r-- | app/views/request/_search_ahead.html.erb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/views/request/_search_ahead.html.erb b/app/views/request/_search_ahead.html.erb index 7120f3862..f77f5b3ee 100644 --- a/app/views/request/_search_ahead.html.erb +++ b/app/views/request/_search_ahead.html.erb @@ -3,12 +3,12 @@ <% if @xapian_requests.results.any? %> <h3><%= _("Possibly related requests:") %></h3> - <% end %> - <% @xapian_requests.results.each do |result| %> - <%= render :partial => 'request/request_listing_short_via_event', - :locals => { :event => result[:model], - :info_request => result[:model].info_request } %> + <% @xapian_requests.results.each do |result| %> + <%= render :partial => 'request/request_listing_short_via_event', + :locals => { :event => result[:model], + :info_request => result[:model].info_request } %> + <% end %> <% end %> <p> |