<div id="search-results">

  <% if (@searched_stories + @searched_snippets).empty? %>
   <br>
    <h3> We couldn't find any content Containing "<%= params[:search] %>"</h3>
  <% elsif !@searched_stories.empty? %>
    <h3> Stories with "<%= params[:search] %> in the title: " </h3>
    <% @searched_stories.each do |story| %>
      <% display_string = story.title %>
      <% x = params[:search].upcase %>
       <% if display_string.include?(params[:search]) %>
        <% display_string.sub!(params[:search], x ) %>
         <br>
        <li><%= link_to display_string, story_path(story) %></li>
      <% end %>
    <% end %>
  <% end %>

  <% if @searched_snippets.empty? %>
  <br>
    <h3>We couldn't find any Snippets containing "<%= params[:search] %>".</h3>
  <% else %>
    <h3> Snippets that contain"<%= params[:search] %>":</h3>
    <% @searched_snippets.each do |snip| %>
    <li><%= link_to snip.content, snippet_path(snip) %></li>
   <% end %>
  <% end %>

</div>





<div class="row">
  <div class="large-vine columns"
<div id="search-results">
  <% if (@searched_stories + @searched_snippets).empty? %>
  <br>
    <h3> We couldn't find any content containing "<%= params[:search] %>".</h3>
  <% elsif !@searched_stories.empty? %>
    <div class="dashboard-header"> Stories with "<%= params[:search] %> in the title: " </div>
    <% @searched_stories.each do |story| %>
      <% display_string = story.title %>
      <% x = params[:search]%>
      <% if display_string.include?(params[:search]) %>
        <% display_string.sub!(params[:search], "<mark><strong>#{x}</strong></mark>" ) %>
        <br>
        <li><%= link_to display_string.html_safe, story_path(story) %></li>
      <% end %>
    <% end %>
  <% end %>

  <% if !@searched_snippets.empty? %>
  <br>
    <div class="dashboard-header">Snippets that contain"<%= params[:search] %>":</div>
    <% @searched_snippets.each do |snip| %>
    <% display_string = snip.content %>
    <% x = params[:search]%>
    <% display_string.sub!(params[:search], "<mark><strong>#{x}</strong></mark>" ) %>
    <li><%= link_to snip.content.html_safe, snippet_path(snip) %></li>
   <% end %>
  <% end %>

</div>
</div></div>





Add logic to hightlight snippets that contain keywords
Add logic to hightlight snippets that contain keywords
