Sha256: 9cba6fae69263f8f51978cadc1b3f631d25dc7be727ddc794ad4ea2c979fafd3

Contents?: true

Size: 802 Bytes

Versions: 10

Compression:

Stored size: 802 Bytes

Contents

module PagesHelper

  def tkhed(content)
    content = generate_contact_form(content)
    content = generate_upcoming_events_list(content)    #
  end

  private

  def generate_contact_form(content)
    # general TKH CMS feature
    # the legacy syntax -- (-: contact_us_form :-)
    content = content.gsub(/\(-: contact_us_form :-\)/, render('contacts/form')) if content.match(/\(-: contact_us_form :-\)/)
    # the new syntax -- tkh_contact_form
    content = content.gsub(/tkh_contact_form/, render('contacts/form')) if content.match(/tkh_contact_form/)
    content
  end

  def generate_upcoming_events_list(content)
    # from the tkh_events gem
    content = content.gsub /tkh_upcoming_events/, render('events/upcoming_events_list') if content.match(/tkh_upcoming_events/)
    content
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
tkh_content-0.10.10 app/helpers/pages_helper.rb
tkh_content-0.10.9 app/helpers/pages_helper.rb
tkh_content-0.10.8 app/helpers/pages_helper.rb
tkh_content-0.10.7 app/helpers/pages_helper.rb
tkh_content-0.10.6 app/helpers/pages_helper.rb
tkh_content-0.10.5.1 app/helpers/pages_helper.rb
tkh_content-0.10.5 app/helpers/pages_helper.rb
tkh_content-0.10.4 app/helpers/pages_helper.rb
tkh_content-0.10.3 app/helpers/pages_helper.rb
tkh_content-0.10.2 app/helpers/pages_helper.rb