Sha256: 9369f76e81618473d46686526c3ec590db471bf48300bc56b41eea32aab60425
Contents?: true
Size: 514 Bytes
Versions: 28
Compression:
Stored size: 514 Bytes
Contents
# frozen_string_literal: true module EffectivePageSectionsHelper def effective_page_sections @_effective_page_sections ||= Effective::PageSection.all end def render_page_section(name, &block) raise('expected a name') unless name.present? name = name.to_s page_section = effective_page_sections.find { |ps| ps.name == name } return if page_section.blank? if block_given? yield(page_section); nil else page_section.rich_text_body.to_s.html_safe end end end
Version data entries
28 entries across 28 versions & 1 rubygems