Module: Cms::MobileHelper

Defined in:
app/helpers/cms/mobile_helper.rb

Instance Method Summary collapse

Instance Method Details

#full_site_urlObject



4
5
6
7
8
9
10
11
# File 'app/helpers/cms/mobile_helper.rb', line 4

def full_site_url
  options = {
      :host => Rails.configuration.cms.site_domain,
      path: current_page.path,
      params: {:prefer_full_site => true}
  }
  ActionDispatch::Http::URL.url_for(options)
end

#mobile_site_urlObject



13
14
15
16
17
18
19
20
# File 'app/helpers/cms/mobile_helper.rb', line 13

def mobile_site_url
  options = {
      :host => Rails.configuration.cms.site_domain,
      path: current_page.path,
      params: {:prefer_mobile_site => true}
  }
  ActionDispatch::Http::URL.url_for(options)
end

#mobile_template_exists?(page) ⇒ Boolean

Determines if the mobile template exists for a given page. Used by view to show/hide the mobile toggle.

Returns:

  • (Boolean)


24
25
26
# File 'app/helpers/cms/mobile_helper.rb', line 24

def mobile_template_exists?(page)
  controller.template_exists?(page.layout_name, "layouts/mobile")
end