app/models/notebook.rb
def snippet(user)
    highlights = GalleryLib.escape_highlight(fulltext_snippet)
    recommendations = recommendation_snippet
    snippet =
      if highlights && recommendations
        "#{highlights}<br><br>#{recommendations}"
      elsif highlights
        highlights
      elsif recommendations
        recommendations
      else
        ''
      end
    show_score = (user.admin? && respond_to?(:score) && score && score >= 0.0)
    snippet += " <em>[#{format('%.4f', score)}]</em>" if show_score
    snippet
  end
# Snippet from fulltext and/or suggestions
Snippet from fulltext and/or suggestions
Snippet from fulltext and / or suggestions
def snippet(user)
    highlights = GalleryLib.escape_highlight(fulltext_snippet)
    recommendations = recommendation_snippet
    snippet =
      if highlights && recommendations
        "#{highlights}<br><br>#{recommendations}"
      elsif highlights
        highlights
      elsif recommendations
        recommendations
      else
        ''
      end
    show_score = (user.admin? && respond_to?(:score) && score && score >= 0.0)
    snippet += " <em>[#{format('%.4f', score)}]</em>" if show_score
    snippet
  end
def snippet ( user ) highlights = GalleryLib . escape_highlight ( fulltext_snippet ) recommendations = recommendation_snippet snippet = if highlights && recommendations "#{highlights}<br><br>#{recommendations}" elsif highlights highlights elsif recommendations recommendations else '' end show_score = ( user . admin? && respond_to? ( :score ) && score && score >= 0.0 ) snippet += " <em>[#{format('%.4f', score)}]</em>" if show_score snippet end
Snippet from fulltext and/or suggestions
Snippet from fulltext and / or suggestions
user