Catch render errors and display 'Couldn't find anything' instead of stacktrace

This commit is contained in:
Pfingstfrosch
2020-05-29 16:12:23 +02:00
parent f96ed67cf0
commit 84cf537412
3 changed files with 34 additions and 22 deletions
@@ -1,20 +1,24 @@
<h1>Results for "<%= params[:search_term] %>"</h1>
<ul class="projects-list">
<% @projects.each_with_index do |project| %>
<li class="project">
<%= link_to crawlers_projects_crawler_show_detail_url(:id => project['id'], :title => project['title']) do %>
<% if @projects %>
<% @projects.each_with_index do |project| %>
<li class="project">
<%= link_to crawlers_projects_crawler_show_detail_url(:id => project['id'], :title => project['title']) do %>
<span class="list-link">
<span class="project-title">
<%= project['title'] %>
</span>
</span>
<% end %>
<span class="add-to-fav">
<% end %>
<span class="add-to-fav">
<%= link_to crawlers_projects_crawler_add_to_fav_url(:id => project['id'], :title => project['title']) do %>
<%= show_svg('favorite-24px.svg') %>
<% end %>
</span>
</li>
</li>
<% end %>
<% else %>
Could not find anything... Please try again.
<% end %>
</ul>