Module: Scidea::Hsfc::Policies::Helpers::PoliciesHelper

Defined in:
lib/scidea/hsfc/policies/helpers/policies_helper.rb

Instance Method Summary collapse

Instance Method Details

#hsfc_policies_label(locale, setting_name, t_key) ⇒ Object



7
8
9
10
11
12
# File 'lib/scidea/hsfc/policies/helpers/policies_helper.rb', line 7

def hsfc_policies_label(locale, setting_name, t_key)
  link_tag = Setting.value(setting_name)
  label = t(t_key)

  label.sub(/<a>([^<]*)<\/a>/, link_tag).html_safe
end

#hsfc_policies_privacy_policy_label(locale) ⇒ Object



14
15
16
17
# File 'lib/scidea/hsfc/policies/helpers/policies_helper.rb', line 14

def hsfc_policies_privacy_policy_label(locale)
  locale ||= I18n.default_locale
  hsfc_policies_label(locale, "Registration: Privacy Policy URL (#{locale})", 'registration.privacy')
end

#hsfc_policies_terms_label(locale) ⇒ Object



19
20
21
22
# File 'lib/scidea/hsfc/policies/helpers/policies_helper.rb', line 19

def hsfc_policies_terms_label(locale)
  locale ||= I18n.default_locale
  hsfc_policies_label(locale, "Registration: Terms and Conditions URL (#{locale})", 'registration.terms_and_conditions')
end