Class: Kuhsaft::SitemapsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/kuhsaft/sitemaps_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



3
4
5
6
7
8
9
10
11
# File 'app/controllers/kuhsaft/sitemaps_controller.rb', line 3

def index
  last_page = Kuhsaft::Page.published.last
  if stale?(etag: last_page, last_modified: last_page.updated_at.utc)
    respond_to do |format|
      format.html
      format.xml { @pages = Kuhsaft::Page.published }
    end
  end
end