method

highlight

highlight(text, phrase, highlighter = '<strong class="highlight">\\1</strong>')
public

Highlights phrase everywhere it is found in text by inserting it into a highlighter string. The highlighter can be specialized by passing highlighter as a single-quoted string with \1 where the phrase is to be inserted.

  highlight('You searched for: rails', 'rails')
   => You searched for: <strong class="highlight">rails</strong>