Skip to content
Browse files

add no results for [blank] message for searches with no result.

  • Loading branch information...
1 parent 4f3c380 commit fcb9065ac3945c47387097f6ef56ed6c01a7366d @chrisftw chrisftw committed with ugisozols Sep 14, 2012
Showing with 13 additions and 9 deletions.
  1. +12 −9 app/views/refinery/search/show.html.erb
  2. +1 −0 config/locales/en.yml
View
21 app/views/refinery/search/show.html.erb
@@ -3,17 +3,20 @@
<% end %>
<% 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 %>
+ <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>
+ <% end %>
<% end %>
</ul>
-
<% end %>
<%= render "/refinery/content_page" %>
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}'.

0 comments on commit fcb9065

Please sign in to comment.
Something went wrong with that request. Please try again.