ruby on rails - ActionView::Helpers::TextHelper excerpt helper is not fully functional -


i using module actionview::helpers::texthelper generate excerpt text. if word exists more once, excerpt first occurrence.

<%= excerpt('hello, ruby lover, rails lover , never come php', 'lover', :radius => 5) %>
"...lover,..."

i expecting return string like, becauee there 2 occurrences of word 'lover':

"...lover,...lover ..."

how can work display multiple occurrences of keyword?

i using rails 3.2.11.

excerpt(text, phrase, options = {}) link:

extracts excerpt text matches first instance of phrase. :radius option expands excerpt on each side of first occurrence of phrase

as documantation states, first instance of phrase search, not every instance of it


Comments