Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Added messaging for empty search results. #28

Closed
wants to merge 1 commit into from

2 participants

@chrisftw

quick fix to add messaging when search results are empty.

@ugisozols
Owner

Merged in fcb9065. Thanks!

@ugisozols ugisozols closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 12 additions and 7 deletions.
  1. +11 −7 app/views/refinery/search/show.html.erb
  2. +1 −0  config/locales/en.yml
View
18 app/views/refinery/search/show.html.erb
@@ -4,13 +4,17 @@
<% content_for :body do %>
<ul id="search_results">
- <% @results.each do |result| %>
- <li>
- <span class='result_type'>
- <%= result_type result %>
- </span>
- <%= link_to result_title(result).html_safe, result_url(result) %>
- </li>
+ <% if @results.empty? %>
+ <%= t('.no_results_for', :what => params[:query]) %>
+ <% else %>
+ <% @results.each do |result| %>
+ <li>
+ <span class='result_type'>
+ <%= result_type result %>
+ </span>
+ <%= link_to result_title(result).html_safe, result_url(result) %>
+ </li>
+ <% end %>
<% end %>
</ul>
View
1  config/locales/en.yml
@@ -7,3 +7,4 @@ en:
search:
show:
search_results_for: Search Results for '%{what}'
+ no_results_for: No results found for your search '%{what}'.
Something went wrong with that request. Please try again.