<% @searches.each do |search| %> <%= link_to search.search_type, overview_searches_path(search_type: search.search_type), class: "type-link type-link-#{@search_types.index(search.search_type)}" %> <% name = Searchjoy.query_name ? Searchjoy.query_name.call(search) : search.query %> <% if Searchjoy.query_url %> <%= link_to name, Searchjoy.query_url.call(search), target: "_blank" %> <% else %> <%= name %> <% end %> <% if search.converted_at %> <% convertable = Searchjoy.multiple_conversions ? search.conversions.min_by(&:created_at)&.convertable : search.convertable %> <%= convertable ? (Searchjoy.conversion_name ? Searchjoy.conversion_name.call(convertable) : "#{convertable.model_name.name} #{convertable.id}") : "Converted" %> <% end %> <%= time_ago_in_words search.created_at %> ago
<%= pluralize search.results_count, "result" %>
<% end %>