Class: PagesCore::SitemapsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- BaseController
- ApplicationController
- PagesCore::SitemapsController
- Includes:
- PagePathHelper
- Defined in:
- app/controllers/pages_core/sitemaps_controller.rb
Instance Attribute Summary
Attributes included from Authentication
Instance Method Summary collapse
Methods included from PagePathHelper
Methods included from StaticCacheController
#disable_static_cache!, #static_cached?
Methods included from PoliciesHelper
#policy, #verify_policy, #verify_policy_with_proc
Methods included from ProcessTitler
inc_number_of_requests, original_title
Methods included from LocalesHelper
Methods included from ErrorRenderer
Methods included from Authentication
#authenticate!, #deauthenticate!, #logged_in?
Instance Method Details
#index ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'app/controllers/pages_core/sitemaps_controller.rb', line 8 def index @sitemaps = PagesCore::Sitemap.sitemaps.flat_map do |entry| if entry.is_a?(Proc) locales.map { |l| instance_exec(l, &entry) } else entry end end.compact_blank.uniq end |
#pages ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/pages_core/sitemaps_controller.rb', line 18 def pages render_sitemap do |map| Page.published.where.not(skip_index: true) .localized(content_locale).find_each do |page| next if page.redirects? map.add(page_url(page.locale, page), lastmod: page.updated_at) end end end |