Module: ApplicationHelper

Includes:
Stimulus::TagHelper
Defined in:
app/helpers/application_helper.rb

Instance Method Summary collapse

Methods included from Stimulus::TagHelper

#stimulus

Instance Method Details

#devise_mappingObject



29
30
31
# File 'app/helpers/application_helper.rb', line 29

def devise_mapping
  @devise_mapping ||= Devise.mappings[:user]
end

#hh_meta_tagsObject



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'app/helpers/application_helper.rb', line 33

def hh_meta_tags
  params = {
    title: site_title,
    description: site_description,
    reverse: true,
    keywords: site_keywords,
    charset: 'utf-8',
    open_search: {
      title: 'Hungry Hub',
      href: "#{Figaro.env.hh_host_url!}/restaurants/opensearch.xml",
    },
    twitter: {
      site: '@hungryhub',
      account_id: '2228367530',
    },
    fb: {
      page_id: '372850069508787',
      admins: '',
      app_id: '1377993762506689',
    },
  }
  display_meta_tags params
rescue StandardError => e
  APMErrorHandler.report(e, params)
  ''
end

#resourceObject



25
26
27
# File 'app/helpers/application_helper.rb', line 25

def resource
  @resource ||= User.new
end

#resource_nameObject



21
22
23
# File 'app/helpers/application_helper.rb', line 21

def resource_name
  :user
end

#site_descriptionObject



13
14
15
# File 'app/helpers/application_helper.rb', line 13

def site_description
  AdminSetting.with_lang('default_site_description', MyLocaleManager.normalize_locale)
end

#site_keywordsObject



17
18
19
# File 'app/helpers/application_helper.rb', line 17

def site_keywords
  AdminSetting.with_lang('default_site_keywords', MyLocaleManager.normalize_locale)
end

#site_titleObject



9
10
11
# File 'app/helpers/application_helper.rb', line 9

def site_title
  AdminSetting.with_lang('default_site_title', MyLocaleManager.normalize_locale)
end