Sha256: e3108da440b8f7074f0a278dca825ee76dc6d6b6ae34d9109615390b50f1ad8e
Contents?: true
Size: 883 Bytes
Versions: 5
Compression:
Stored size: 883 Bytes
Contents
module PrometheeData extend ActiveSupport::Concern def data_page_title data['attributes']['searchable_title'] end def data_page_description data['attributes']['searchable_description'] end def data=(value) value = JSON.parse value if value.is_a? String super(value) end def data_searchable promethee_extract_searchable data end protected include ActionView::Helpers::SanitizeHelper def promethee_extract_searchable(component) searchable = ' ' component['attributes'].each do |key, value| if key.starts_with? 'searchable_' clean_value = strip_tags value searchable += "#{clean_value} " end end if component.include? 'attributes' component['children'].each do |child| searchable += promethee_extract_searchable child end if component.include? 'children' searchable end end
Version data entries
5 entries across 5 versions & 1 rubygems