Class: Postnhost::SitemapController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Postnhost::SitemapController
- Defined in:
- app/controllers/postnhost/sitemap_controller.rb
Instance Method Summary collapse
Instance Method Details
#show ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'app/controllers/postnhost/sitemap_controller.rb', line 3 def show sitemap_builder = Postnhost::SitemapBuilder.new(request:, site_url: current_setting.effective_site_url.presence || request.base_url) sitemap_xml = Rails.cache.fetch(sitemap_builder.cache_key, expires_in: 1.hour) do sitemap_builder.call end render xml: sitemap_xml end |