Sha256: 76a9049baa8b5a2d395a9a82fbd0499b58b0515ada5c6683dba1ad7191439216
Contents?: true
Size: 331 Bytes
Versions: 15
Compression:
Stored size: 331 Bytes
Contents
module SearchHelper def highlight(object, field) object.try(:hit).try(:highlight).try(field) end def highlighted(object, field) if h = object.try(:hit).try(:highlight).try(field).try(:first) h.html_safe else field.to_s.split('.').reduce(object) { |result,item| result.try(item) } end end end
Version data entries
15 entries across 15 versions & 2 rubygems